Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry shell modifies $TERM env variable within tmux #7861

Open
4 tasks done
owittek opened this issue May 2, 2023 · 4 comments
Open
4 tasks done

poetry shell modifies $TERM env variable within tmux #7861

owittek opened this issue May 2, 2023 · 4 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@owittek
Copy link

owittek commented May 2, 2023

  • 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.

@owittek owittek added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 2, 2023
@owittek owittek changed the title poetry shell modifies $TERM env variable within TMUX poetry shell modifies $TERM env variable within tmux May 2, 2023
@dimbleby
Copy link
Contributor

dimbleby commented May 2, 2023

Not a zsh user and no idea what the implications of emulate are, but you can read all about its introduction at #5795

I avoid poetry shell altogether, just activate the virtual environment yourself as though poetry shell did not exist

@owittek
Copy link
Author

owittek commented May 2, 2023

Not a zsh user and no idea what the implications of emulate are, but you can read all about its introduction at #5795

I avoid poetry shell altogether, just activate the virtual environment yourself as though poetry shell did not exist

Yeah I do the same thing to prevent this issue but I still wanted to report this so it can be fixed eventually if it's not just an issue on my side.

@dimbleby
Copy link
Contributor

dimbleby commented May 2, 2023

if you know how to fix it, submit a merge request!

(personally I'd like to see poetry shell removed altogether, anyway I wouldn't expect that waiting for someone else to fix such things is likely to be a successful strategy)

@owittek
Copy link
Author

owittek commented May 2, 2023

I've actually skimmed the code for poetry shell but I didn't look for where the emulate command is being invoked. I'll try to confirm my suspicion later on & if it's true I'll also look more in-depth into the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants