bugGNU nano - Bugs: bug #51335, in some terminals, the cursor can...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #51335: in some terminals, the cursor can be misplaced with --softwrap --nohelp --constantshow

Submitter:  David Lawrence Ramsey <dolorous>
Submitted:  Wed 28 Jun 2017 04:54:16 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Fri 27 Nov 2020 01:25:07 PM UTC, comment #9: 

Updated recipe...  First comment out the lines in src/winio.c that "Defeat a VTE/Konsole bug" and recompile.

Then make your terminal 54 columns wide and run:

LANGUAGE=en src/nano -SIcalx +18 doc/faq.html

Then type <End>.  See that the cursor is placed correctly.

Type: x ^S ^X, and run the same command again.
Type <End> and see that the cursor is placed correctly.

Do that last dance two more times.  The cursor is placed fine.  Both on Xfce Terminal 0.8.7.4 and Konsole 20.08.3.

So, for VTE, the bug has been fixed before libvte 0.52 (that is: before 2018).  For Konsole, I'm going to guess that it was fixed before 2020, before ncurses-6.2, so that the workaround can be excluded for builds on modern systems.

The workaround has been conditionalized on ncurses before version 6.2 by commit fe22da6b.

Benno Schulenberg <bens>
Group administrator
Fri 30 Jun 2017 08:33:06 AM UTC, comment #8: 

Fixed in git, b93767b5.  Thanks for reporting.

Benno Schulenberg <bens>
Group administrator
Thu 29 Jun 2017 07:42:41 PM UTC, comment #7: 

Yes, it does.  Thanks.

David Lawrence Ramsey <dolorous>
Group Member
Thu 29 Jun 2017 07:32:12 PM UTC, comment #6: 

Okay.  Attached is more economical version of the patch: it avoids an extra wrefresh() call.  Does this fix the issue too?

(file #41075)

Benno Schulenberg <bens>
Group administrator
Thu 29 Jun 2017 06:27:55 PM UTC, comment #5: 

Yes, it does fix the problem for both xfce-terminal and Konsole.  And if the fix is that simple, I say go for it.

Normally, I use a terminal at 80x24 or larger; I only found this when trying to duplicate the softwrap bug you found in a 50-column screen.  Still, I do have to shrink the terminal sometimes for whatever reason, so this will be useful then.

As for the options, constant cursor display, no help lines, and softwrap, add --morespace to those and you get maximum info combined with  maximum screen real estate usage, even when you have to use a smaller terminal :)

David Lawrence Ramsey <dolorous>
Group Member
Thu 29 Jun 2017 06:10:06 PM UTC, comment #4: 

The fix is easy enough: just do a cursor move and another screen update, just like at the end of bottombars().  See attached patch.  Does this fix the problem also for your current Konsole?

But... there are very few people that use a terminal narrower than 80 columns and constant cursor display and no help lines and softwrap.  I /think/ you might be the only one.  :)  If you used such a narrow terminal.


(file #41074)

Benno Schulenberg <bens>
Group administrator
Thu 29 Jun 2017 04:24:39 PM UTC, comment #3: 

Good to know.  If it's fixed on more modern systems, it may not be worth the effort, unless the fix turns out to be incredibly simple and won't unnecessarily clutter things.

I didn't know you could run vte directly; thanks for the info.  Also, turning on a blinking cursor in xfce-terminal (which is only available by manually editing a config file, as opposed to properly putting it in the settings GUI like Konsole) doesn't change what happens in the buggy versions, and neither does turning a blinking cursor off in Konsole.

For the record, Slackware-current has vte 0.44.3, which sounds like it's recent enough to avoid the problem.  Also, there are packages to upgrade Slackware 14.2 or -current to KDE5 if one wanted to test KDE5's Konsole to see if it avoids the problem (except that the site I'd get the packages from seems to be down right now).

But the main reason I've so far stuck with Slackware 14.2 plus the terminals I've added is that I only have the one machine for development and everything else, and I'm a bit paranoid about potentially breaking it at the moment.  The new vte needs a glib/gtk+ upgrade relative to Slackware 14.2 if I recall correctly; and KDE5 can't be installed alongside KDE4, but needs to replace it, and it isn't even in Slackware-current yet.  Either option requires a lot of upgrading.

David Lawrence Ramsey <dolorous>
Group Member
Thu 29 Jun 2017 08:15:21 AM UTC, comment #2: 

I've run the reproduction recipe

  src/nano --ig --so --con --noh  +16,1  doc/faq.html

on several distros, and these are the results:

  Ubuntu Lucid       libvte 0.23.5  affected
  Elementary Luna    libvte 0.32.1  affected
  Linux Mint Sarah   libvte 0.42.5  good
  Manjaro (rolling)  ...vte 0.48.3  good

(Lucid is from April 2010, Luna is based on Ubuntu Precise from April 2012, Sarah is based on Ubuntu Xenial from April 2016.)

I've also run the recipe on Salix (basically Slackware 14.2).  It is also affected and it seems to have vte 0.28.2.  Also when running vte directly (instead of through xfce4-terminal), the program is affected.  But, when instead running vte-2.91 directly, the program is free from the cursor misplacement.  So... maybe it isn't even a vte bug but a default misconfiguration?

Also, when using a 40-column terminal instead of a 50-column one, when the cursor is misplaced after an <End>, then toggling constantshow off and on doesn't put the cursor in the right place.  This is because the toggle feedback also completely fills the bottom row of the screen, using also the last cell, pushing the cursor "offscreen".

What do you think?  Do we need a workaround for the people who build nano on older machines, or on machines that have a KDE Konsole instead of a modern VTE-based Terminal?

(I wish I had an Ubuntu Trusty from 2014 somewhere.  If that one already is okay, I would say: don't bother, people should upgrade.  But if it is affected...)

Benno Schulenberg <bens>
Group administrator
Wed 28 Jun 2017 04:56:49 PM UTC, comment #1: 

Forgot one detail: since xfce-terminal is based on vte, the version  of xfce-terminal that shows the bug is using vte 0.28.2.

David Lawrence Ramsey <dolorous>
Group Member
Wed 28 Jun 2017 04:54:16 PM UTC, original submission:  

This can be reproduced with current git (c0a5237) as follows:

1. In a 50x24 terminal, in the src/ directory, run:

./nano --ignore --softwrap --const --nohelp +16,1 ../doc/faq.html

2. Press End.  The cursor will be placed properly in terms of file location (the final space of "  <a href="#1.4">1.4. What is the current version "), but will be misplaced in some terminals.

In xterm [X.Org 7.7.0(325)], rxvt [v2.7.10], rxvt-unicode  [v9.22], and Eterm [0.9.6], the cursor is placed properly.

In xfce4-terminal [0.6.3 (Xfce 4.12)], the cursor will not be visible until you press Left or Right to move the cursor, or you press Ctrl-L to force a refresh.

In konsole [Qt: 4.8.7; KDE Development Platform: 4.14.32; Konsole: 2.14.2], the cursor will be placed at the beginning of the next line (and if the "Blinking cursor" option is activated via Settings -> Edit current profile -> Advanced, when the cursor is placed this way, it will not be blinking), until you press Left or Right to move the cursor, or you press Ctrl-L to force a refresh.

In the buggy cases, running the command in (1) without the --const option will not trigger the bug, and neither will running the command in (1) without the --nohelp option; both options are necessary.

David Lawrence Ramsey <dolorous>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #41075:  more-economical-version.patch added by bens (519B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by dolorous (Submitted the item)
  •  

    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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-22 bens Open/ClosedOpen Closed
    2017-06-30 bens Severity3 - Normal 2 - Minor
        StatusIn Progress Fixed
        Assigned toNone bens
        Summaryin some terminals, the cursor can be misplaced with --softwrap --constant --nohelp in some terminals, the cursor can be misplaced with --softwrap --nohelp --constantshow
    2017-06-29 bens Attached File- Added more-economical-version.patch, #41075
    2017-06-29 bens Attached File- Added defeat-another-VTE-KDE-bug.patch, #41074
        StatusNone In Progress
        Summaryin some terminals, the cursor can be misplaced with --softwrap --const --nohelp in some terminals, the cursor can be misplaced with --softwrap --constant --nohelp
    2017-06-29 bens Summaryin some terminals. cursor can be misplaced with --softwrap, --const and --nohelp in some terminals, the cursor can be misplaced with --softwrap --const --nohelp

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code