-
-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem with using backspace for Chinese characters(one char of 2 bytes) #422
Comments
This might not be entirely supported yet, since the ssh-chat/sshd/terminal/terminal.go Lines 491 to 495 in 0eebb64
I am not super familiar enough with the keyboard I/O code personally, but I don't think ssh-chat is contextually aware of what your user locale is going to be exactly. The server side is responsible for key inputs and rendering the readline functionality, but its probable that ssh-chat doesn't have enough contextual information for each user to be able to do this. To ssh-chat, when you enter a 2-byte character, ssh-chat sees exactly 2-bytes. It doesn't process whether or not that might be a rune, it only handles it at an individual byte level. |
Hi @jonnyliang, I'm not able to reproduce this. It may be an issue with your terminal, or compatibility between your terminal and how we handle unicode character width counting: What terminal are you using? Could you try a modern terminal like kitty or alacritty? |
Yea, that's a terminal issue unfortunately, they don't count character width the same way as modern terminals. There's no way to support both. |
You are right, this a terminal issue unfortunately, it will leave half of a char when I using XSHELL 5. it work by using alacritty! thanks! |
// |
If you have a patch that fixes this and doesn't break other things, please make a PR and I'll take a look. :) |
I just modified content of two functions,Hope for better solution! ssh-chat/sshd/terminal/terminal.go
|
Describe the bug
Chinese (one char of 2 bytes ) input support is not very good when using Backspace key,
pelases check the eraseNPreviousChars in the file “/sshd/terminal)/terminal.go”,
I guess the n is wrong as below, because it real moved two place,so there n should be 2 not 1,
405 for i := 0; i < n; i++ {
406 t.queue(space)
407 }
408 t.advanceCursor(n)
Versions
To Reproduce
Steps to reproduce the behavior:
thank you for you sharing,it is help for my work!
The text was updated successfully, but these errors were encountered: