-
Notifications
You must be signed in to change notification settings - Fork 64
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
Terminal cursor hidden after audit failure #280
Comments
$ gnome-terminal --version
# GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD
$ code --version
1.67.1
da15b6fd3ef856477bf6f4fb29ba1b7af717770d
x64
EDIT: I should have used my own test case, the bug occurs in both VS Code and Gnome Terminal. |
Thanks for the report, and for listing the terminals! I can't reproduce this locally ( |
Just from a quick look: this is probably a consequence of us overriding def finish(self):
if self.file and self.is_tty():
print(file=self.file)
if self._hidden_cursor:
print(SHOW_CURSOR, end='', file=self.file)
self._hidden_cursor = False I'm not sure why this doesn't cause problems on |
Okay, I think I figured it out -- this is probably a small behavioral difference between versions of CPython. On my local machine (Python 3.10), My guess is that older versions of CPython (3.8 at least) don't explicitly |
@tysonclugg I've opened #281 with a potential fix. Could you give the changes on that branch a try and let me know if they work for you? |
@woodruffw Yes, that's fixed it for me. Thanks! |
Your prompt may include a control sequence that ensures the cursor is visible, which would mask the problem. I'm considering doing exactly this myself... |
Thanks for confirming! We'll have a patch release out for this today. |
Released with 2.3.1. |
## [2.3.1] - 2022-05-24 ### Fixed * CLI: A bug causing the terminal's cursor to disappear on some versions of CPython was fixed ([#280](pypa/pip-audit#280))
Bug description
After a failed audit, the terminal cursor remains hidden rather than being restored to a visible state. This makes it difficult to use the terminal, unless the cursor is restored with the
reset
command (which has the downside of clearing the scrollback buffer) or through other more esoteric means (eg:echo -en "\e[?25h"
).Reproduction steps
Using the BASH shell:
Expected behavior
The cursor should either remain visible, or be restored to it's visible state after the command completes.
Platform information
pip-audit
version (pip-audit -V
):pip-audit 2.3.0
python -V
orpython3 -V
):Python 3.8.10
pip
version (pip -V
orpip3 -V
):pip 22.1 from /home/<redacted>/.venv/lib/python3.8/site-packages/pip (python 3.8)
The text was updated successfully, but these errors were encountered: