-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Shell prompt stops responding to terminal resize event after poetry shell
#6351
Comments
Hi @PythonTryHard -- a minimal reproduction without oh-my-zsh would be wonderful. Certainly I would consider the stock ZSH prompt not working in the subshell to be a Poetry issue, but I don't think we can reasonably work around bugs in every third party prompt (even one as widely used as oh-my-zsh). If it can be demonstrated that Poetry does this even without oh-my-zsh, we can certainly consider it a flaw in Poetry. |
It can be reproduced with PROMPT="%n@%M> "
RPROMPT="%T%D" Though frankly, you should only need the |
This issue is present in the bash and fish default prompts as well. |
Given that |
oh-my-zsh
prompt stops responding to terminal resize event after poetry shell
poetry shell
Could someone affected provide a recording of what exactly is happening? From my initial investigation, it works fine. |
@Secrus Here you go. This is done with the sudo useradd -m zsh_repro
sudo su zsh_repro
cd ~ to ensure it's just bare
outside-poetry-shell.mp4
inside-poetry-shell.mp4 |
@PythonTryHard could you check if the same happens with |
@Secrus In the same bare user at /opt/python-3.10.6/bin/pip install --user pipenv # My Python is hand-compiled and installed there
.local/bin/pipenv shell Output (
and nope, |
Poetry at 1.1.15 uses clikit's Terminal implementation. cleo's terminal at 1.0.0a5 has a bug. clikit's implmentation initializes the width and height as instance variables. cleo's implementation at this version initializes the width and height as variables in the This is fixed as of now in master, as per PR #6224, as cleo and poetry both replaced their implementation with calls using shutil, but remains an issue in the 1.2.0 release. I believe this may be related to issue #4165. |
Well, that last part is not true. Change to |
This is not correct, you've linked to the branch (where the fix has been backported) but it did not make it to the 1.2.0 release - https://github.com/python-poetry/poetry/blob/1.2.0/src/poetry/utils/shell.py#L102 |
🤣 seems that I am blind. Good to know, I was going crazy trying to figure out why it breaks... So, basically, we are waiting for 1.2.1 release. |
I've encountered what appears to be the same problem, with vim -- not a shell -- exhibiting the symptoms, and in a way that can be directly queried. System:
First, here's a control, showing what should happen:
N.B.: Quitting and relaunching vim (steps 5 and 7) shouldn't be necessary; vim notices when the terminal window has resized, and adapts accordingly. I'll explain below why I added those two steps. Now, to reproduce the issue: Follow the above steps, but after step (1), type N.B. Restarting vim (steps 5 and 7) demonstrates that the problem is not a single vim process's failure to notice the size change. Even a vim that's newly launched after the window is resized reports the width from before the resize occurred. To try to isolate the problem, I did manually what I believe
This does work properly. So it's not the activation of the venv per se that's causing the problem; it's something else that Nor is it a change to the UNIX environment that's doing it. env(1) produces almost the same output from the From the poetry subshell, I unset those two environment variables, which exactly mimicked the environment from the manual-activation shell -- but that did not fix the problem. So whatever |
The issue is known/solved on the 1.2 branch -- the signal handler for
|
Yes, that version works. Thanks. |
This was effectively fixed in the 1.2.1 release (right?) but isn't listed in the release-notes for that release. Could it be added there? |
Good catch -- looks like it was overlooked as #6224 was labeled as a refactor and not a bug fix (and thus dropped as a non-changelog change) since it wasn't realized this would also fix a bug (instead of just being more correct). Feel free to issue a PR with the changelog entry -- I can update the release notes and release a post-release on PyPI (though this latter step is a chore and we'll likely skip it as we intend to cut 1.2.2 imminently). |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).1.2.0
Issue
Steps to reproduce:
zsh
shell withoh-my-zsh
installed. Any theme would do, but for ease of viewing, setZSH_THEME
in.zshrc
to"dst"
.poetry shell
.poetry shell
. Resize the terminal.Expected behaviour:
The prompt responds normally to terminal resize events.
Actual behaviour:
The prompt does not respond to terminal resize events. What
Notes:
zsh
withoh-my-zsh
has been testedstdout
is not affectedThe text was updated successfully, but these errors were encountered: