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

Feature request: Improve handling of terminal sequences #30

Open
NicoWeio opened this issue Jun 18, 2024 · 3 comments
Open

Feature request: Improve handling of terminal sequences #30

NicoWeio opened this issue Jun 18, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@NicoWeio
Copy link

The documentation does include a warning that those are not supported (here), but say one doesn't see that.
In my experience, the results then vary from a few escape sequences becoming visible (neofetch | tte decrypt) to pages worth of gibberish (neofetch | tte --no-color decrypt).
Couldn't we do one of the following instead?

  • Output the unmodified stream (i.e. without applying any effect) if we detect any unwanted terminal sequences
  • Return a warning/error message
  • Actually support such sequences (no clue how difficult that would be)
@ChrisBuilds
Copy link
Owner

Output the unmodified stream (i.e. without applying any effect) if we detect any unwanted terminal sequences

Perhaps, but I think we would end up with reports from folks thinking TTE is broken rather than gracefully quitting.

Return a warning/error message

This seems like a reasonable approach.

Actually support such sequences (no clue how difficult that would be)

There is another issue open regarding supporting existing colors. It's in my todo list. That being said, Neofetch and some other applications use complex sequences to handle formatting as well as color. To fully support these, I would basically be building a sequence parser/emulator into TTE, which is beyond a reasonable scope.

I agree that TTE should do something when encountering unsupported escape sequences (aka non-color), and will consider a solution for an upcoming release. Thanks for the issue.

@ChrisBuilds ChrisBuilds added the enhancement New feature or request label Jun 19, 2024
@adavies42
Copy link

how about this?

  1. strip all terminal sequences off the text
  2. apply the tte effect
  3. replace the final frame with the original, colored/formatted text

@ChrisBuilds
Copy link
Owner

ChrisBuilds commented Oct 2, 2024

Just an update on this, the 0.12.0 dev branch has added support for preexisting 8/24 bit foreground and background color sequences. Support for this feature has to be added to all existing effects, so that will take time. See Issue 37 for current progress.

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

No branches or pull requests

3 participants