question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
neersightedcommented, Sep 14, 2022

Dupe #6351

0reactions
max-sixtycommented, Jun 12, 2022

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Poetry Shell: How to shorten bash prefix - Stack Overflow
This means, if you change the prompt prefix of the virtualenv, you change the poetry prefix. 1) Find the path of your virtualenv:...
Read more >
Documentation/Configure.help - pub/scm/linux/kernel/git ...
auto detected or can be forced by using a kernel command line option. such as "mem=256M". ... provided by the VGA text console...
Read more >
narcissism - OSCHINA - 中文开源技术交流社区
OSCHINA.NET 是目前领先的中文开源技术社区。我们传播开源的理念,推广开源项目,为 IT 开发者提供了一个发现、使用、并交流开源技术的平台.
Read more >
Untitled
Lunafly lost stars. Swfc transfer rumours owlstalk, Helvetiastrasse 15. Answerer folklore, Yahoo singapore facebook, Cerotti nivea contro punti neri!
Read more >
Volume 3, Bonus Issue #1 - HP Computer Museum
Macintosh--without losing your data or formatting! ... Getting Started columns, consult the HP 95LX ... We carry HP's full line of PC's, Sub...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found