Cygwin: Add IUTF8 termios iflag
The termios code doesn't handle erasing of multibyte characters in canonical mode, it always erases a single byte. When entering a multibyte character and then pressing VERASE, the input ends up with an invalid character. Following Linux we introduce the IUTF8 input flag now, set by default. When this flag is set, VERASE or VWERASE will check if the just erased input byte is a UTF-8 continuation byte. If so, it erases another byte and checks again until the entire UTF-8 character has been removed from the input buffer. Note that this (just as on Linux) does NOT work with arbitrary multibyte codesets. This only works with UTF-8. For a discussion what happens, see https://cygwin.com/ml/cygwin/2017-01/msg00299.html Sidenote: The eat_readahead function is now member of fhandler_termios, not fhandler_base. That's necessary to get access to the terminal's termios flags. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -115,6 +115,7 @@ POSIX commands */
|
||||
#define IUCLC 0x04000
|
||||
#define IXANY 0x08000
|
||||
#define PARMRK 0x10000
|
||||
#define IUTF8 0x20000
|
||||
|
||||
/* oflag bits */
|
||||
|
||||
|
Reference in New Issue
Block a user