xonsh / xonsh

:shell: Python-powered shell. Full-featured and cross-platform.
http://xon.sh
Other
8.17k stars 632 forks source link

Windows: How to use xonsh --shell-type=readline #3409

Open halloleo opened 4 years ago

halloleo commented 4 years ago

I have a brand-new install of Python with xonsh on Windows 7. I need to use --shell-type=readline, so I am wondering which readline library I should install.

I tried pyreadline 2.1, but with that I get the depreciation warning C:\sw\Python\Python38\lib\site-packages\pyreadline\py3k_compat.py:8: Deprecation Warning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated. This warning is known from other third-party modules in xonsh (see e.g. issue #2872).

Note: prompt-toolkit is not an option because it doesn't work with --shell-type=readline.

gforsyth commented 4 years ago

Hey @halloleo -- @melund may be able to weight in here, but I know we've strongly recommended using prompt_toolkit on windows for a while now because the various readline options were suboptimal.

Is there a particular reason you need to use the readline shell on Windows?

halloleo commented 4 years ago

Yep, indeed: I am running xonsh inside an Emacs shell-buffer and for this xonsh needs to interface via simple readline - because prompt_toolkit cannot degrade to a dump terminal.

jonathanslenders commented 4 years ago

I'm working on a fix for this: https://github.com/prompt-toolkit/python-prompt-toolkit/pull/1035

scopatz commented 4 years ago

readline doesn't really work on windows (outside of the WLS)

anki-code commented 3 years ago

This question looks solved and should be closed.

halloleo commented 3 years ago

No, no, cannot be closed yet. It needs to be tested, whether ptk is a viable alternative to readline on dump terminals! I will try it when I get around to it.

jnoortheen commented 2 years ago

pyreadline is not maintained and has problems with py3.10 . I think we should mention it somewhere in the docs for the windows Installation and install ptk on windows by default?