-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bash environment variable COLUMNS
locked in Pipenv shell if exported.
#6169
Comments
tfpf
added a commit
to tfpf/WSLNotify
that referenced
this issue
Jun 4, 2024
This seems like a bug in the underlying shellingham that we (and poetry ) use. |
@oz123 Would it be possible for you to provide some code showing why that is the case? I can file bug with Shellingham if required. |
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. Line 102 in 7493d18
This seems to cause the error:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: