GNU nano - Bugs: bug #48852, when the terminal is narrow, the...
You are not allowed to post comments on this tracker with your current authentication level.
bug #48852: when the terminal is narrow, the cursor is placed wrongly in the prompt bar
Submitter: | Benno Schulenberg <bens> | ||
Submitted: | Mon 22 Aug 2016 09:54:04 AM UTC | ||
Severity: | 3 - Normal | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Jump to the original submission
Sat 28 Nov 2020 02:53:22 PM UTC, comment #8: |
Benno Schulenberg <bens> |
Thu 25 Aug 2016 09:09:32 AM UTC, comment #7: The problem has been reported upstream (https://lists.gnu.org/archive/html/bug-ncurses/2016-08/msg00021.html) and it appears to be partly a bug in VTE, and partly an optimization in ncurses (which goes wrong when COLS does not match the real right margin of the terminal).
|
Benno Schulenberg <bens> |
Wed 24 Aug 2016 09:48:00 AM UTC, comment #6: When in src/global.c you change N_("Prepend") to N_("Prep"), and run 'stty cols 27 && LANGUAGE=en src/nano --ignore NEWS && stty cols 120' and type ^O, the cursor is placed correctly. When you add back an "e" to make it N_("Prepe"), the cursor is placed wrongly.
|
Benno Schulenberg <bens> |
Mon 22 Aug 2016 08:15:39 PM UTC, comment #5: Ugh. It can't be fixed. Apply the attached patch, which fixes the --ignorercfiles case. But now run 'stty cols 27 && LANGUAGE=en src/nano --ignore --nohelp NEWS', and see how the cursor is still placed wrong. Press <Left> four times -- upon the third <Left>, the cursor jumps two places. The cursor never lands on the W. When you put it on the S (meaning it is in fact on the W) and type xx, the exes get inserted before the W. Bleh! What the smurf is going on? |
Benno Schulenberg <bens> |
Mon 22 Aug 2016 06:09:22 PM UTC, comment #4: The bug is in ncurses. To prove it, apply the attached patch, run 'stty cols 27 && LANGUAGE=en src/nano NEWS', press ^O, wait for the beep, press <Left> at least four times, then press ^G ^G. Both before and after the ^Gs, the cursor is placed wrongly: on the E of NEWS.
|
Benno Schulenberg <bens> |
Mon 22 Aug 2016 01:39:39 PM UTC, comment #3: On a Linux console, the cursor is placed always correctly. On a VTE or an xterm, if the cursor is placed wrong and you do a <Left> followed by a ^G ^G, the cursor will be placed correctly -- and will stay placed correctly as long as you don't do a ^G ^G again while the cursor is in the last two possible columns.
|
Benno Schulenberg <bens> |
Mon 22 Aug 2016 11:41:44 AM UTC, comment #2: Run 'stty cols 12 && src/nano --ignore --nohelp NEWS', then type ^O <Left> <Left> <Left> <Left>. The statusbar ends with ":$ N", which is wrong. Now press ^G ^G. Now the statusbar ends with ": N ", which is better -- but the cursor is placed not on the N but after it, and the space after the N should be a $.
|
Benno Schulenberg <bens> |
Mon 22 Aug 2016 10:09:27 AM UTC, comment #1: Hrm. When using '--ignore --nohelp --bold', the cursor is placed correctly. When leaving out the --bold, the cursor is placed wrong. Also when in the .nanorc file a titlecolor is given, the cursor is placed correctly with --nohelp. Maybe I'm looking at a bug in ncurses here. |
Benno Schulenberg <bens> |
Mon 22 Aug 2016 09:54:04 AM UTC, original submission:
To reproduce, do 'stty cols 12 && src/nano --ignore NEWS' and type ^O. The prompt bar will show: "File Nam:$ C" (where C is the cursor). When you press <Left> a few times, it will show each of the letters of "NEWS" at the very end of the prompt bar, instead of right after the $. When you then press <Right>, it will show an extra $: "File Nam:$$C". Which is wrong.
|
Benno Schulenberg <bens> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2016-09-02 | bens | Open/Closed | Open | Closed | |
2016-08-25 | bens | Status | Confirmed | Fixed | |
2016-08-24 | bens | Status | In Progress | Confirmed | |
2016-08-22 | bens | Attached File | - | Added 0001-statusbar-place-the-cursor-correctly-also-when-near-.patch, #38321 | |
2016-08-22 | bens | Attached File | - | Added proving-the-point.patch, #38317 | |
Status | None | In Progress |
Powered by Savane 3.13-4b48.
Corresponding source code
The workaround was removed two days ago in commit 39705c60 as 1) for the most part it was only reproducible by setting COLS to a value that did not match the width of the terminal, and 2) I cannot reproduce it any more on Xubuntu 18.04 (libvte 0.52), so... people that are still stuck with an older libvte can stay with nano-5.3 (or earlier) or upgrade their whole system.