helpThe GNU Bourne-Again SHell - Support: sr #109337, Soft hyphen displayed, but not...


sr #109337: Soft hyphen displayed, but not counted by backspace

Submitted by:  None
Submitted on:  Thu 22 Jun 2017 02:58:35 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Works For Me
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 23 Jun 2017 07:26:19 PM UTC, comment #2:

When I try this on xterm with LANG=en_US.UTF-8, wcwidth returns 1 for that character, but when you write it to the display, it's displayed as the two letters you observed. The readline redisplay code expects wcwidth(C) column positions to be consumed by character C when you write it to the display, and the discrepancy (which I assume happens with your console as well) messes up the calculations readline needs to perform for redisplay.

In this case, it means that readline thinks the cursor is one position to the right of where it actually is when you insert that character. If readline doesn't get good information about what actually happens with the current display, it's going to make redisplay mistakes because its assumptions about where it is and where it needs to move the cursor are off.

On Mac OS X Terminal, where it's displayed as a single physical character -- the soft hyphen -- everything works as expected.

Chet Ramey <chet>
Project Administrator
Thu 22 Jun 2017 03:58:53 PM UTC, comment #1:

The described behaviur has been observed for
GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)

Quite old, I know. But for
GNU bash, version 4.4.12(1)-release (x86_64-suse-linux-gnu)

the soft hyphen (\xC2\xAD) was ugly displayed by two letters (Ã-), and in this case the backspace missed two characters to delete.

jgr <jgr>
Thu 22 Jun 2017 02:58:35 PM UTC, original submission:

If I input a soft hyphen at the console, f.e. by pressing the compose key and afterwards '-' twice and space key once, it is displayed, but when removing the input by backspace it removes one character less than shown for each soft hyphen (as if the soft hyphens would not have been displayed). In the end there remains a rest of undeletable characters on the line, but just displayed – on pressing enter the command line seems like an empty command line.



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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by jgr (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-06-23 chet StatusNone => Works For Me

    Back to the top

    Powered by Savane 3.3