GNOME Bugzilla – Bug 158200
terminal backspace behavior not set to UTF-8 mode
Last modified: 2006-07-30 23:32:57 UTC
This bug report is supposed to be a reopening of bug #129317, since that one is closed, I have no permission to reopen that, but is not yet properly fixed. Whenever I change to utf8 or 8-bit mode inside the running vte app, either by escape sequences, or via the menu of gnome-terminal, the IUTF8 stty settings are changed correctly. (It's a different story that bash likes to revert these settings but that's nothing vte can do about it...) However, on startup, if I have an UTF-8 locale, the IUTF8 flag of the terminal is not set. vte_terminal_init() calls vte_terminal_set_encoding(), which in turn calls _vte_pty_set_utf8(), but this time pty_master doesn't yet have its real value, it is -1, and hence _vte_pty_set_utf8() exits without doing anything. Hence the initialization fails. _vte_pty_set_utf8() should be called once again when pty_master has its real value.
Created attachment 33736 [details] [review] solves the problem for me Probably not the best way to solve this problem, but at least it works for me.
Can you write a patch to remember the utf8 state and make the proper call during fork?
Humm, thinking again, this probably should be closed as OBSOLETE, right? Backspace works correctly these days. Reopen if I'm wrong.
vte 0.12.2 is buggy. Here's how to test it: set your locale to UTF-8 (e.g. export LC_ALL=en_US.UTF-8), start vte (or g-t --disable-factory), here launch the "cat" command. Type a few accented letters, press backspace several times and press Enter. The line echoed back will not be the same at the one you've edited: every backspace only removed one byte instead of one whole multibyte character from the kernel's tty buffer. Here's a screenshot if I type áéí and then press two backspaces followed by the Enter: $ cat á áé $ The expected screenshot (vte with my patch) is of course this: $ cat á á $ PS. I don't really understand your request with the fork.
Ah, very true. I was asking that instead of your patch, have a variable in terminal->pvt to that is set to true if encoding is set to utf8, and use that in the fork command, instead of your g_get_charset call.
2006-07-30 Behdad Esfahbod <behdad@gnome.org> Bug 158200 – terminal backspace behavior not set to UTF-8 mode Based on patch from Egmont Koblinger * src/vte.c (_vte_terminal_setup_utf8), (vte_terminal_set_encoding), (_vte_terminal_fork_basic), (vte_terminal_set_pty): Make sure UTF-8 state is correctly set when pty changes.