Skip to content
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

Issue representing multi byte green checkmark? #141

Open
risner opened this issue Dec 22, 2024 · 5 comments
Open

Issue representing multi byte green checkmark? #141

risner opened this issue Dec 22, 2024 · 5 comments

Comments

@risner
Copy link

risner commented Dec 22, 2024

First, thanks for this release. It has vastly improved my life (and continued ability to use nvi).

My issue is about using this checkmark symbol:

I have nvi version 2.2.1 (2023-09-25 installed and when I use this symbol I see a multibyte code and it has difficulty with cursor position on the line after. The displayed code on screen is \u2705. I'm not sure if I'm using it incorrectly or have a feature disabled that is causing this. But many other codes seem to work perfectly.

@lichray
Copy link
Owner

lichray commented Dec 22, 2024

I don't notice an issue... Please share a video/gif clip if possible. Also, which terminal you're using? I'm using mintty.

@risner
Copy link
Author

risner commented Dec 22, 2024

Alacrity 0.14.0 (1)

Sorry it is so long...

Alacrity displays correctly when cat'ing the file, just not in nvi2.
https://github.com/user-attachments/assets/6b352ae7-ddd2-43b3-a128-39ad6cf8f6a1

@lichray
Copy link
Owner

lichray commented Dec 22, 2024

When cat'ing something, it's only terminal in play. nvi2 is a program that obeys your locale. When you see some Unicode characters displayed as-is but not others, it may be because your locale does not consider the character printable. What's your current locale? Please share environment variables such as LANG and LC_CTYPE. In my case, if I set LC_CTYPE to zh_CN.GB18030 and terminal mode to GBK, I can edit Chinese but see the checkmark displayed as \u2705. If I set LC_CTYPE to zh_CN.UTF-8 and terminal mode to UTF-8, I can see the checkmark displayed as a checkmark. Note that different OSs name locale differently; the appropriate locale on your system may not be any of these.

About the cursor behavior around \u2705, this is a nvi2 feature to display something that cannot be printed in multiple glyphs. It's still one character, so you won't be able to point to 2 or 5.

If you found some U+1nnnn characters to be displayed as-is but U+2nnn characters to be displayed in this fallback mechanism, that behavior would sound like a bug (although solving it doesn't address your issue).

@risner
Copy link
Author

risner commented Dec 23, 2024

% setenv | egrep 'LANG|LC_CTYPE'

% stty
speed 9600 baud;
lflags: echoe echoke echoctl pendin
iflags: iutf8
oflags: -oxtabs
cflags: cs8 -parenb

% echo $TERM
xterm-256color

I don't typically set any of those environment variables. Also, I'm on macOS 15.1 (24B83) M3

@lichray
Copy link
Owner

lichray commented Dec 23, 2024

It seems that Alacrity at least tried to follow system locale (alacritty/alacritty@7901b45#diff-35bac35ab4fe2dcd2348a1e8ea0541e66f4a5dfd0ee9569cfa33479a21c3f3a3R64) so I'm not sure how do you have LC_CTYPE not set, but you can set it manually according to the last few comments in alacritty/alacritty#2566. Anyhow, please give locale names such as en_US.UTF-8 a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants