Skip to content
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

Autosuggestions are hard to read on old windows cmd.exe #13519

Open
anntzer opened this issue Feb 8, 2022 · 6 comments
Open

Autosuggestions are hard to read on old windows cmd.exe #13519

anntzer opened this issue Feb 8, 2022 · 6 comments
Labels
autosuggestions Related to fish-like autosuggestion feature (as opposed to the tab-completions) UI

Comments

@anntzer
Copy link
Contributor

anntzer commented Feb 8, 2022

The old cmd.exe does not support dim text (see e.g. tartley/colorama#305 -- which admittedly only shows that a popular text-coloring library does not support dim text on Windows, but still...), so autosuggestions are rendered as normal text, which makes the whole thing rather difficult to read (you end up with a block of white text and a cursor in the middle as if in "text replace" mode).
I would suggest to detect this setup and disable autosuggestion by default in that case (or make enable_autosuggestion a tri-state True/False/"auto" (i.e. True except on cmd.exe)).
Note that things render just fine on the more modern windows terminals.

@Carreau
Copy link
Member

Carreau commented Feb 8, 2022

Do you know how to detect this ?

@anntzer
Copy link
Contributor Author

anntzer commented Feb 8, 2022

No guarantees, but the following seems to work: use psutil.Process().parent().parent().<etc>.name() to lookup the parent process chain. The current process will be python.exe; it can have a parent of ipython.exe (if ipython was launched as "ipython" from the command line) or this parent can be skipped; the next parent will then be the shell (e.g., "cmd.exe"). The parent of cmd.exe will then be either "explorer.exe" (old-style terminal, no support for dim text -- my guess is that "cmd.exe's parent is explorer.exe" would be a good condition where to disable autosuggestions) or the newer "WindowsTerminal.exe" (which does support dim text) -- or possibly other terminals.

@bollwyvl
Copy link
Contributor

bollwyvl commented Feb 8, 2022

I'm a VM-only windows user, but: use of the new windows terminal is so life-changing to that experienece vs cmd.exe, it's hard to overestimate. They've preserved all the important bugs, unlike powershell/cmder/wsl, so old, important scripts work as intended when written 30 years ago, but is not an entirely broken UI.

@anntzer
Copy link
Contributor Author

anntzer commented Feb 8, 2022

I know, I use the windows terminal whenever I can, but some machines (e.g. tethered to specific lab equipement items) are effectively non-upgradeable.

@MrMino
Copy link
Member

MrMino commented Feb 27, 2022

@bollwyvl @anntzer could one of you post a screenshot of this issue please?

@MrMino MrMino added the UI label Feb 27, 2022
@anntzer
Copy link
Contributor Author

anntzer commented Mar 2, 2022

test
Note the cursor under the "n"; everything after was autocompleted.

@MrMino MrMino added the autosuggestions Related to fish-like autosuggestion feature (as opposed to the tab-completions) label Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosuggestions Related to fish-like autosuggestion feature (as opposed to the tab-completions) UI
Projects
None yet
Development

No branches or pull requests

4 participants