You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If COLUMNS is exported prior to starting a Pipenv shell in Bash, it does not get updated upon resizing the terminal window, even if the checkwinsize Bash setting is enabled.
Expected result
If the terminal window is resized, COLUMNS should get updated, irrespective of whether Bash is running in a normal shell or a Pipenv shell, or if it has been exported.
Actual result
COLUMNS does not get updated in a Pipenv shell if it has been exported.
Steps to replicate
Open a terminal (running Bash) in any directory. (No Pipfile is required, since Pipenv creates one.) Ensure that it is running Bash.
Run shopt -s checkwinsize.
Run export COLUMNS.
[optional] Resize the terminal window and run echo $COLUMNS. Repeat a couple of times. The output of the command reflects the width of the terminal.
Run pipenv shell.
Run shopt -s checkwinsize (just to be sure).
Resize the terminal window and run echo $COLUMNS. Repeat a couple of times. The output of the command does not reflect the width of the terminal; it remains fixed.
Additional Information
In step 5, instead of running pipenv shell, if I:
run bash, or
load the virtual environment manually by running . ~/.local/share/virtualenvs/path-to-venv/bin/activate,
then there is no issue: COLUMNS gets updated as expected. Which leads me to believe this is a Pipenv issue. I cleared ~/.bashrc prior to executing all of the above steps. I am using GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu).
which discuss the same issue with Poetry. They mention this is not observed with Pipenv; however, if COLUMNS is exported, Pipenv suffers from the same problem.
Sorry, on a second thought, it's probably not shelling ham. When you run pipenv shell, it's calling shelling ham to detect the shell, and then it calls pexpect.
Issue description
If
COLUMNS
is exported prior to starting a Pipenv shell in Bash, it does not get updated upon resizing the terminal window, even if thecheckwinsize
Bash setting is enabled.Expected result
If the terminal window is resized,
COLUMNS
should get updated, irrespective of whether Bash is running in a normal shell or a Pipenv shell, or if it has been exported.Actual result
COLUMNS
does not get updated in a Pipenv shell if it has been exported.Steps to replicate
Pipfile
is required, since Pipenv creates one.) Ensure that it is running Bash.shopt -s checkwinsize
.export COLUMNS
.echo $COLUMNS
. Repeat a couple of times. The output of the command reflects the width of the terminal.pipenv shell
.shopt -s checkwinsize
(just to be sure).echo $COLUMNS
. Repeat a couple of times. The output of the command does not reflect the width of the terminal; it remains fixed.Additional Information
In step 5, instead of running
pipenv shell
, if I:bash
, or. ~/.local/share/virtualenvs/path-to-venv/bin/activate
,then there is no issue:
COLUMNS
gets updated as expected. Which leads me to believe this is a Pipenv issue. I cleared~/.bashrc
prior to executing all of the above steps. I am using GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu).See also
poetry shell
locks terminal width python-poetry/poetry#4121poetry shell
python-poetry/poetry#6351which discuss the same issue with Poetry. They mention this is not observed with Pipenv; however, if
COLUMNS
is exported, Pipenv suffers from the same problem.$ pipenv --support
Pipenv version:
'2023.12.1'
Pipenv location:
'/usr/lib/python3.12/site-packages/pipenv'
Python location:
'/usr/bin/python'
OS Name:
'posix'
User pip version:
'23.3.2'
user Python installations found:
PEP 508 Information:
System environment variables:
SHELL
SESSION_MANAGER
WINDOWID
COLORTERM
XDG_SESSION_PATH
GNOME_DESKTOP_SESSION_ID
LC_ADDRESS
LC_NAME
CINNAMON_VERSION
DESKTOP_SESSION
LC_MONETARY
GTK_MODULES
XDG_SEAT
PWD
LOGNAME
XDG_SESSION_DESKTOP
QT_QPA_PLATFORMTHEME
XDG_SESSION_TYPE
XAUTHORITY
XDG_GREETER_DATA_DIR
GJS_DEBUG_TOPICS
MOTD_SHOWN
HOME
LC_PAPER
LANG
XDG_CURRENT_DESKTOP
VTE_VERSION
XDG_SEAT_PATH
GJS_DEBUG_OUTPUT
XDG_SESSION_CLASS
TERM
LC_IDENTIFICATION
USER
DISPLAY
SHLVL
LC_TELEPHONE
LC_MEASUREMENT
XDG_VTNR
XDG_SESSION_ID
XDG_RUNTIME_DIR
DEBUGINFOD_URLS
LC_TIME
GTK3_MODULES
PATH
GDMSESSION
DBUS_SESSION_BUS_ADDRESS
MAIL
GIO_LAUNCHED_DESKTOP_FILE_PID
GIO_LAUNCHED_DESKTOP_FILE
LC_NUMERIC
_
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
SHELL
:/bin/bash
LANG
:en_GB.UTF-8
PWD
:/home/tfpf/Documents/projects/pipenv-bug
Contents of
Pipfile
('/home/tfpf/Documents/projects/pipenv-bug/Pipfile'):The text was updated successfully, but these errors were encountered: