Backspace over CJK should move cursor back by 2
By egm... on October 01, 2010 22:03 (imported from Google Code)
Start the "cat" command, enter a double width symbol, then press backspace. The cursor moves back by 1 cell only, hence not to the beginning of the line. It should go back by 2 cells.
Start the "cat" command, type "abcd方" followed by 3 backspaces, then enter. You'll see this:
$ cat
abc
ab
^D
(It's similar to issue #72 (closed), just the other way around. There the display was correct, but the in-kernel buffer was constructed incorrectly. Here the in-kernel tty line buffer is correct, the visual representation by iTerm is not.)
Note that it's only about the case when the user hits the backspace key in cooked terminal mode.
If an application prints the backspace character (usually, but not necessarily the terminal is in raw mode then), the application should assume the cursor moves back by one cell only. E.g. if in bash you press backspace to remove a CJK character, it emits two ^H's, that's okay this way, and iTerm's behavior is correct here, move left by one cell only on each ^H, this shouldn't be changed.