[SERVER-2852] Linenoise doesn't work well with some terminals Created: 28/Mar/11 Updated: 25/Nov/14 Resolved: 07/Dec/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 1.9.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kristina Chodorow (Inactive) | Assignee: | Tad Marshall |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux (and other Unix-like OSes) |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
Particularly rxvt. This is like death by 1000 paper cuts: nothing major, but super annoying. 1) refreshing the line (on backspaces, moving the cursor left, etc.) messed up the prompt (resulting in ">> "). #1 (and maybe #2) is because rxvt expects \xb1[1G to return to the start of a line and xterm expects \xb1[0G. I have a feeling that there are a million of these and there's a reason readline is huge. Working on the ones listed above, I'll submit fixes upstream. |
| Comments |
| Comment by Tad Marshall [ 07/Dec/11 ] |
|
I talked to Kristina and there are no issues here specifically related to one terminal program versus another. It is the lack of specific readline features that is the problem, so this is a duplicate of |
| Comment by Tad Marshall [ 02/Dec/11 ] |
|
Kristina, can you please either add the names of some terminals I should test, or point me to some online list of popular ones I should look at? Most of the (current) code is just assuming that we're running on a VT100 or something close, though we have some keyboard handling that (piecemeal) accepts non-VT100 sequences. I have tested against Gnome terminal (as provided in Ubuntu) and also against xterm and rxvt and I don't see any terminal-specific issues with any of that set. If there are popular ones that I don't know about, it would help me to know what they are. readline doesn't itself contain any real terminal-specific code (like escape sequence stuff), but it knows a lot about how to get that information from Linux. linenoise is much more from the "just hard-code it" school, so if we want support for a diverse set of terminals we either need to add a lot of hard-coding or do it the readline way, and get the info from Linux. Either way, I need some failing test cases to do anything with this bug. Oh, and the cut-and-paste EMACS feature is part of what I'm planning on doing for Thanks! |
| Comment by Tad Marshall [ 05/Oct/11 ] |
|
Regarding the comment "rxvt expects \xb1[1G to return to the start of a line and xterm expects \xb1[0G", this isn't quite correct. The ESC [ <param> G behaves like some similar VT100 escape sequences and provides a default value which can be explicitly "defaulted" by using a 0 as the parameter. So, ESC [ 1 G is an explicit command to go to the leftmost column and ESC [ 0 G is a more verbose way of saying ESC [ G and means to go to the default column, which is the leftmost one. So, this is a bug in rxvt: it isn't that xterm wants a zero, it just works correctly when it gets one. The code in linenoise.cpp is fixed as you said and uses ESC [ 1 G to work right in both emulators. |
| Comment by Kristina Chodorow (Inactive) [ 12/Apr/11 ] |
|
#1 & #2 are now fixed. Another one: Ctrl-y doesn't paste Ctrl-k'd strings. |