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

refactor!: delete duplicate utf8-functionality #31934

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dundargoc
Copy link
Member

@dundargoc dundargoc commented Jan 9, 2025

Also remove SCS support from :terminal.

@github-actions github-actions bot added the refactor changes that are not features or bugfixes label Jan 9, 2025
@dundargoc dundargoc force-pushed the refactor/delete-utf8-code branch 7 times, most recently from 0b37b93 to 7c727d6 Compare January 9, 2025 22:09
@dundargoc dundargoc marked this pull request as ready for review January 9, 2025 22:09
@dundargoc dundargoc requested a review from justinmk January 9, 2025 22:52
src/nvim/mbyte_defs.h Outdated Show resolved Hide resolved
@zeertzjq zeertzjq added the terminal built-in :terminal or :shell label Jan 10, 2025
@zeertzjq
Copy link
Member

zeertzjq commented Jan 10, 2025

You are removing the SCS support from :terminal. Isn't this a breaking change?

@dundargoc dundargoc force-pushed the refactor/delete-utf8-code branch 3 times, most recently from ca1bee8 to 7be80f1 Compare January 10, 2025 06:36
@dundargoc dundargoc changed the title refactor: delete duplicate utf8-functionality refactor!: delete duplicate utf8-functionality Jan 10, 2025
src/nvim/vterm/state.c Outdated Show resolved Hide resolved
Comment on lines 213 to 248
static const struct StaticTableEncoding encoding_DECdrawing = {
{ .decode = &decode_table },
{
[0x60] = 0x25C6, // BLACK DIAMOND
[0x61] = 0x2592, // MEDIUM SHADE (checkerboard)
[0x62] = 0x2409, // SYMBOL FOR HORIZONTAL TAB
[0x63] = 0x240C, // SYMBOL FOR FORM FEED
[0x64] = 0x240D, // SYMBOL FOR CARRIAGE RETURN
[0x65] = 0x240A, // SYMBOL FOR LINE FEED
[0x66] = 0x00B0, // DEGREE SIGN
[0x67] = 0x00B1, // PLUS-MINUS SIGN (plus or minus)
[0x68] = 0x2424, // SYMBOL FOR NEW LINE
[0x69] = 0x240B, // SYMBOL FOR VERTICAL TAB
[0x6a] = 0x2518, // BOX DRAWINGS LIGHT UP AND LEFT (bottom-right corner)
[0x6b] = 0x2510, // BOX DRAWINGS LIGHT DOWN AND LEFT (top-right corner)
[0x6c] = 0x250C, // BOX DRAWINGS LIGHT DOWN AND RIGHT (top-left corner)
[0x6d] = 0x2514, // BOX DRAWINGS LIGHT UP AND RIGHT (bottom-left corner)
[0x6e] = 0x253C, // BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL (crossing lines)
[0x6f] = 0x23BA, // HORIZONTAL SCAN LINE-1
[0x70] = 0x23BB, // HORIZONTAL SCAN LINE-3
[0x71] = 0x2500, // BOX DRAWINGS LIGHT HORIZONTAL
[0x72] = 0x23BC, // HORIZONTAL SCAN LINE-7
[0x73] = 0x23BD, // HORIZONTAL SCAN LINE-9
[0x74] = 0x251C, // BOX DRAWINGS LIGHT VERTICAL AND RIGHT
[0x75] = 0x2524, // BOX DRAWINGS LIGHT VERTICAL AND LEFT
[0x76] = 0x2534, // BOX DRAWINGS LIGHT UP AND HORIZONTAL
[0x77] = 0x252C, // BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
[0x78] = 0x2502, // BOX DRAWINGS LIGHT VERTICAL
[0x79] = 0x2A7D, // LESS-THAN OR SLANTED EQUAL-TO
[0x7a] = 0x2A7E, // GREATER-THAN OR SLANTED EQUAL-TO
[0x7b] = 0x03C0, // GREEK SMALL LETTER PI
[0x7c] = 0x2260, // NOT EQUAL TO
[0x7d] = 0x00A3, // POUND SIGN
[0x7e] = 0x00B7, // MIDDLE DOT
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the line drawing character set since there is at least one known application which uses it (and box drawing is not an extremely uncommon use case).

foot, Ghostty, and libvaxis all support the box drawing character set (possibly others, these are just the ones I know of for sure).

Copy link
Member

@clason clason Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But are they (foot, Ghostty, libvaxis) using these characters and not the unicode ones?

(Link from chat for the "one known application": https://github.com/pimutils/khal)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's the vaxis embedded terminal that supports that character set. It didn't initially but we received bug reports in aerc for khal which used that charset for the box drawing glyphs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But are they (foot, Ghostty, libvaxis) using these characters and not the unicode ones?

At least Ghostty is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, just wanted to make sure. And they don't prefer the unicode set if that is available?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These work by mapping ascii codepoints to other codepoints. So switching the charset to 0, you can print a j and get a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also sorry, I told Greg the wrong application. It was calcurse which uses the box drawing charset

Copy link
Member Author

@dundargoc dundargoc Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least Ghostty is.

ghostty implements the british and us encoding as well though.

Implemented in ghostty-org/ghostty#9. No good reasoning is really given as to why however...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't initially but we received bug reports in aerc for khal which used that charset for the box drawing glyphs.

@rockorager do you have a link to it so I can get more context?

Copy link
Member Author

@dundargoc dundargoc Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, the drawing character set is widely supported by most terminals and tmux, so it makes some sense to keep it for the time being.

@gpanders

This comment was marked as outdated.

@dundargoc dundargoc marked this pull request as draft January 10, 2025 21:57
@github-actions github-actions bot removed the request for review from justinmk January 10, 2025 21:58
@dundargoc
Copy link
Member Author

TODO:

Also remove SCS support from `:terminal`.
@dundargoc dundargoc force-pushed the refactor/delete-utf8-code branch from 7be80f1 to 1710009 Compare January 11, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:skip-news refactor changes that are not features or bugfixes terminal built-in :terminal or :shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
  NODES
chat 1
COMMUNITY 2
Project 5
todo 1
USERS 1