-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
readline windows issues. #2130
Comments
Another issue with the readline shell. If I excute a command like
|
Hey @melund! Does this happen on both |
Also, if I just start xonsh in readline mode and leave it for 30s I get the history error below:
|
i think powershell added ansi escape codes(?) |
@laerus It has nothing to do with PowerShell. The windows console (conhost.exe) which both PowerShell and cmd.exe use, has gotten full support for ANSI escapes in Windows 10. This is also what Bash uses in the Windows Subsystem for Linux (WSL). I have suggested that PTK should just use ANSI escapes on windows : That would speed PTK a lot and provide true color support. |
playing around on a windows10 machine with this script
it seems that PowerShell correctly clears the screen from the cursor up |
Yes. I think powershell does something to activate the features. Something that also kicks in when I for example call MSys tools from If you notice some of the pictures I posted. The prompt is rerendered in colors. That would work with the readline shell if conhost didn't interpret ansi escapes. I don't know exactly what is going on here. |
Maybe it is something with the codepage, and how output characters are interpreted. |
adding this snippet from here :
solves it! |
Has this been tested on Windows <10? They still exist. |
The method @laerus suggest can be used to detect if Windows has the ansi escape features. I asked this question on microsoft/WSL#1356 last year. If the command fails we can assume it is an older (<10) version of Windows. All the other issues aside we better ensure that @laerus's code snippet is always executed on Windows. |
In terms of integrating the fix, we do have a bit of a windows abstraction layer in winutils. https://github.com/xonsh/xonsh/blob/master/xonsh/winutils.py |
Where are they used? I guess there are options doing many of the same things (finding terminal sizes etc) with ansi escapes? These are some of the things that are now possible on Windows. |
@melund diving into this |
Also worth noting that the fix to pyreadline went in in 2014 |
Well. They haven't even merged the fix. I also just realised that pyreadline is no longer bundled with Anaconda by default. It really seems everyone is abandoning ship. |
Yeah, it does seem that way. I believe that pyreadline's flakiness was one of the reasons for jupyter/ipython abandoning readline. I think this is probably not xonsh issue, but we can maybe patch it in conda-forge. |
Closed by #2208 |
It is has been a while since I used the readline shell on windows. I only switch to it when I need speed.
Now it is giving me some issues:
If I press tab when it launches, the 'Display all ## possibilities' question shows up with ansi escapes:
If I press
n
I get this error:If I press
y
i get an other error:The text was updated successfully, but these errors were encountered: