How to make prompt-toolkit work on dumb terminals
See original GitHub issueOn dumb terminals (TERM=dumb or TERM=unkown) prompt-toolkit behaves strangely: Some message are not displayed, it expects arrow key support, etc.
I was wondering whether it is possible to swap the Vt100Input
class for a class which offers genuinely less capabilities (i.e. no cursor movement, no arrow keys, etc).
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
python-prompt-toolkit - Bountysource
On dumb terminals (TERM=dumb or TERM=unkown) prompt-toolkit behaves ... It is possible to work around this by having key bindings defined as follows, ......
Read more >How to Install prompt-toolkit in Python? - Finxter
Open your Linux terminal or shell · Type “ pip install prompt-toolkit ” (without quotes), hit Enter. · If it doesn't work, try...
Read more >Faq - mycli
Once you get used to that level of pampering, all other REPLs start to look like Dumb Terminals. When I started using psql...
Read more >FAQ - pgcli
Once you get used to that level of pampering, all other REPLs start to look like ... a new Python library that he's...
Read more >your terminal doesn't support cursor position requests (CPR)
(setq python-shell-interpreter-args "--simple-prompt -i"). ipython assumes you have a "normal" terminal, but in Emacs it runs under a "dumb" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow, you are pretty quick with the fix!
I have tried it and it somewhat works. Examples like
get-input.py
orregular-language.py
work fine andauto-suggestion.py
,autocorrection.py
andclock-input.py
degrade reasonably.However I noticed two things:
confirmation-prompt.py
the print result is different: under vt100 terminals it isTrue
/False,
, under dumb terminals it isy
/n
.responds_to_cpr
invt100.py
you still need to set the environment varPROMPT_TOOLKIT_NO_CPR
for better degradation. Is there a chance to check forPROMPT_TOOLKIT_NO_CPR
and forTERM=dumb
?Thanks heaps for looking into this!
+1 for this! My main use case is Emacs as well.