poetry shell loses terminal lines and columns (stuck at 80x25)
See original GitHub issue-
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). (n/a) -
OS version and name: FreeBSD 13.0
-
Poetry version: 1.1.16
Issue
When running poetry shell
my terminal is set to 80x25 regardless of window size. This was originally noticed within tmux, but is reproducible in plain konsole and xterm.
I’ll provide an example from xterm because it’s the most “normal”.
$ tput cols
141
$ tput lines
45
$ poetry shell
Spawning shell within /home/mike/.cache/pypoetry/virtualenvs/arsenal-Cu8X-dwc-py3.9
(arsenal-Cu8X-dwc-py3.9) $ tput cols
80
(arsenal-Cu8X-dwc-py3.9) $ tput lines
25
(arsenal-Cu8X-dwc-py3.9) $ poetry --version
Poetry version 1.1.6
(arsenal-Cu8X-dwc-py3.9) $ echo $TERM
xterm
It causes weird behavior in neovim, less, etc. unless the window is sized to 80x25, which is not ideal.
Manually sourcing the virtualenv does not cause this
$ source `poetry env info --path`/bin/activate
(arsenal-Cu8X-dwc-py3.9) $ tput cols
141
(arsenal-Cu8X-dwc-py3.9) $ tput lines
45
And as a side note, with other projects managed by pipenv, this does not occur in pipenv shell
. Not trying to be inflammatory. I just wanted to note it since it too uses a subshell, but created differently.
I’m sorry that I don’t have a solution to propose or associated PR, as this defies my limited understanding of termcap. I will attempt further research as I have time, but wanted to file this now.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Dupe #6351
Something I’m experimenting with is only running the
activate
script at/Users/{user}/Library/Caches/pypoetry/virtualenvs/{proj}-x204KUJE-py3.9/bin/
.That seems to give the necessary shell configs without the resize etc at https://github.com/python-poetry/poetry/blob/c1475a0b6dd6f4a3e99112cc36b8c0d1024e4048/src/poetry/utils/shell.py.
That said — am I missing something? Why do we need the python code there?