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

8-bit CSI (Windows) #172

Open
adoxa opened this issue May 20, 2021 · 4 comments
Open

8-bit CSI (Windows) #172

adoxa opened this issue May 20, 2021 · 4 comments

Comments

@adoxa
Copy link
Contributor

adoxa commented May 20, 2021

I noticed a "\x9B\xC4" sequence was removed, which was strange, since I've defined all the "extended ASCII" as text. Then I remembered that '\x9B' is the 8-bit CSI. Since Windows doesn't support that, atm I've simply done:

#if MSDOS_COMPILER
#define IS_CSI_START(c) (((LWCHAR)(c)) == ESC)
#else
#define IS_CSI_START(c) (((LWCHAR)(c)) == ESC || (((LWCHAR)(c)) == CSI))
#endif

but I'm not sure if that's really the best approach. Maybe it'd be better to test if the system/charset supports CSI?

@gwsw
Copy link
Owner

gwsw commented May 20, 2021

How are you thinking that the test for CSI would work? I'm don't know how it would be possible to test for CSI support.

@adoxa
Copy link
Contributor Author

adoxa commented May 21, 2021

I thought there'd be something in terminfo for it, but apparently not; by charset I mean something like (((LWCHAR)(c)) == CSI & control_char(c)). It seems that would pretty much only be meaningful on DOS/Windows, anyway, so the compiler test sounds like the way to go, after all.

@gwsw
Copy link
Owner

gwsw commented May 21, 2021

Well, this issue is a little unclear to me. It seems to me that the presence of a 0x9B CSI is related to the source of the document being viewed, rather than the system that less is running on. It seems unexpected behavior that a document containing a 0x9B CSI would appear different when viewed on a Windows system. Maybe this should be controlled by the charset selected?

@adoxa
Copy link
Contributor Author

adoxa commented May 22, 2021

Another issue is that the SGR emulation only detects 7-bit, not 8-bit. I've never come across 8-bit CSI, so I'm content with the compiler #if, which I could just add to my own build.

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