poetry: Shell prompt stops responding to terminal resize event after `poetry shell`
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: KDE neon 5.25 (based on Ubuntu 20.04.1 LTS) fully up-to-date.
- Poetry version:
1.2.0
- Terminal used: Konsole 22.08.0
Issue
Steps to reproduce:
- Set up a
zsh
shell withoh-my-zsh
installed. Any theme would do, but for ease of viewing, setZSH_THEME
in.zshrc
to"dst"
. - Resize the terminal without being inside
poetry shell
. - Enter
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:
- Only
zsh
withoh-my-zsh
has been tested - Only tested on Konsole terminal, other terminals have not been tested
- This issue does not occur on v1.1.x releases of Poetry.
- This affects only the prompt, writing to
stdout
is not affected
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 18 (8 by maintainers)
The issue is known/solved on the 1.2 branch – the signal handler for
SIGWINCH
used a bogus/incorrect method to query the new window size (and thus passed a bad size to the child process). Please try the 1.2 branch and request a re-open if this can be reproduced there:pipx install --suffix @b1.2 git+https://github.com/python-poetry/poetry@1.2
🤣 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.
Well, that last part is not true. Change to
shutil
made it into the 1.2 release: shell.py. I have been looking into what is happening here and my current guess is that somehow old Cleo approach with custom Terminal class, and the change in Poetry 1.2 to usingshutil
solution somehow conflict. I have yet to test it though. Also, with Cleo getting a 1.0 stable release pretty soon, it might resolve on its own with that change.