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

support ANSI OSC escapes as well as CSI colors #220

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

007
Copy link

@007 007 commented Jul 6, 2023

Slightly more complete fix than #206, not sure how you feel about detail-vs-complexity.

CC @tucksaun for potential review

@tucksaun
Copy link

does it really make sense to support other OSCs when displaying a table?
I mean... most of them would probably be used outside of a table context don't you think?

@007
Copy link
Author

007 commented Jul 13, 2023

They'll be interpreted / not-displayed regardless of how the table is printed, does it make sense to make wonky tables whether or not you know or care what the codes are doing? None of these are filtering codes to remove them for printing, just for determining column width.

I haven't been able to find a definitive list of other OSCs that might apply. MinTTY CtrlSeqs wiki seems close, in that it enumerates quite a few. I agree that the majority are likely global / system state, but could see even some of those as useful embedded inline:

  • Wide characters seem like potentially useful escapes embedded within text
  • Emoji style might change the display of those types within a cell? From the description it's unclear how that's intended to be interpreted.
  • Locale might be significant, but more likely would be ignored or embedded in Unicode for e.g. Arabic RTL text
  • Window title set could be used for fun or for nefarious purposes, setting the window title to the "highest" row title for some corresponding value
  • Scroll markers could certainly be used along with colors for something like an error display
  • Audio data shouldn't make a 3k-column-wide table just because someone embedded a beep to draw attention to something

@tucksaun
Copy link

if the goal is to support all those use cases when adding values to the tab then the regex LGTM 👍
Though we probably want to avoid rebuilding it on each call to DisplayWidth

@007
Copy link
Author

007 commented Feb 5, 2024

cc @olekukonko I'm quite a bit behind schedule on updating this, can you 👀 and see if this makes sense?

If so, please merge and tag a new release as requested from #205 (comment), I'd be very happy to get these into our environment.

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.

2 participants