[Bug 211360] ESC characters are not interpreted by /bin/sh

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jul 29 14:38:19 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211360

Jilles Tjoelker <jilles at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jilles at FreeBSD.org

--- Comment #1 from Jilles Tjoelker <jilles at FreeBSD.org> ---
The breaking change is in libedit, not sh itself. The libedit in FreeBSD 11.x
uses a simple screen image array of wide characters indexed by the position, so
characters c with wcwidth(c) == 0 are discarded. This includes not only control
characters but also combining characters such as U+0308 combining diaeresis.
Unix-like systems usually use precomposed characters such as U+00E4 latin small
letter a with diaeresis which do not have this problem but precomposed
characters do not exist for all combinations.

The libedit in FreeBSD 10.x uses a simple screen image array of bytes, all of
which are assumed to be one cell wide. Therefore, control sequences confuse
libedit's idea of the cursor position, and commands longer than the terminal
width are not displayed properly if the prompt contains control sequences.
Libedit has a feature to make this work (EL_PROMPT_ESC) but sh does not support
it and I have not tested it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-amd64 mailing list