python-poetry / python-poetry/poetry-plugin-shell

poetry shell modifies $TERM env variable within tmux

Open
#10 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
141
Forks
10
Avg merge
59m
Merged PRs (30d)
3

Description

  • Poetry version: Poetry (version 1.4.2)
  • Python version: 3.11.3
  • OS version and name: macOS 13.3.1
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Hey, I'm an avid tmux user and love poetry so far, thanks for your work!

The issue I am experiencing is that when I run poetry shell my $TERM env variable is being changed from screen-256color to tmux-256color which breaks my terminal colors. Manually setting it back to screen-256color works fine. I'm running zsh 5.9 as my shell of choice.

EDIT:

I can see that emulate bash -c '. .../.venv/bin/activate' is being run in my shell when I run poetry shell. The command should be POSIX-compatible so I don't see a reason for it to be emulated. Maybe that causes some kind of issues but that's just speculation on my part.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce poetry shell inside tmux using zsh 5.9 and compare $TERM before and after activation. Start at the poetry shell entry point and inspect how .venv/bin/activate is invoked, including the reported emulate bash -c command. Done means activation no longer changes $TERM from screen-256color to tmux-256color and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell, zsh
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.