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

Rewrite cleanText to strip zero width spaces characters #119

Closed
wants to merge 1 commit into from

Conversation

axman6
Copy link
Contributor

@axman6 axman6 commented May 1, 2024

This is a fairly hack fix for the issue that I appear to be the only one suffering from. Certain non-ascii characters cause text to get corrupted in my terminal when using glirc - when connected

(macOS ->) (Alacritty|Terminal.app) -> Mosh -> tmux -> glirc.

All have been configured to understand and use utf-8 characters, but the zero width spaces that get included in the nicks from haskellbridge cause things get garbled. See screen shot and particularly note that the text immediately after nicks:

Screenshot 2024-05-01 at 20 58 42

This problem is so bad that it affects other tmux windows when I switch between them. While other unicode characters like emojis cause problems, the prevalence of the zero width space (see https://www.unicode.org/charts/PDF/U2000.pdf - code 0x200B) is used in the haskellbridge matrix bot on Libera.chat, which causes glirc to be nearly unreadable for me when many matrix users are speaking.

I'm sure this isn't the best implementation of the fix, but I couldn't think of an appropriate character that '\8203' should be replaced with that wouldn't look strange. More than happy to implement alternatives, this is more for discussion that necessarily the final fix.

@axman6
Copy link
Contributor Author

axman6 commented May 1, 2024

Another example from a channel with very little activity after switching from #ghc

Screenshot 2024-05-01 at 21 09 33

@axman6
Copy link
Contributor Author

axman6 commented Aug 12, 2024

It looks like the next release is making good progress, any chance this could be merged in too? I'm using it locally and haven't noticed any issues, and it fixes the bug shown above. Ping @glguy @TheDaemoness

@TheDaemoness
Copy link
Collaborator

This behavior might be Mosh's fault due to a disagreement between the Mosh client and server on the width of the, uh, zero-width space. See mobile-shell/mosh#234 (comment).
Does this still occur when you run glirc directly under Alacritty or Terminal.app on macOS?

@glguy
Copy link
Owner

glguy commented Aug 13, 2024

Fixed by #125

@glguy glguy closed this Aug 13, 2024
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

Successfully merging this pull request may close these issues.

3 participants