You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directly after a pty.Open(), writing some multibyte characters such as 小明 and then a Delete key (0x7f) to the "slave" end, then reading from the "master" end results in a mangled final character. https://gist.github.com/mislav/82c3e2cfa2180c23201a523078b07f07
Expectation: the Delete key causes the whole last character to be deleted, not just its final byte.
Perhaps this library could set IUTF8 by default? I'm not sure if there will be any negative side-effects to that, though. I haven't tested that approach in production.
The text was updated successfully, but these errors were encountered:
Directly after a
pty.Open()
, writing some multibyte characters such as小明
and then a Delete key (0x7f) to the "slave" end, then reading from the "master" end results in a mangled final character. https://gist.github.com/mislav/82c3e2cfa2180c23201a523078b07f07Expectation: the Delete key causes the whole last character to be deleted, not just its final byte.
My colleague @tibbes points out that Darwin has a IUTF8 input flag that can be set on (pseudo) terminals: https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/termios.h#L133
Indeed, doing this fixes the issue:
Perhaps this library could set IUTF8 by default? I'm not sure if there will be any negative side-effects to that, though. I haven't tested that approach in production.
The text was updated successfully, but these errors were encountered: