-
Notifications
You must be signed in to change notification settings - Fork 59
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
Ability to report back slices of printable characters #127
Comments
I'm not sure you can do that either, you don't have stages where you clearly have a string, unless it's some osc/etc. Especially given that some characters end up in What if you just carry a The main issue is that it'll kill all the perf, since you have different states, so buffering won't really work most of the time, and in your case, you can workaround that with just one Like I have an ansi stripper myself and never felt a need for anything like that, mostly because you have buffer writer on the other end and you writing a single char doesn't matter since you don't flush that often. |
I'd also say that any |
I have it implemented without any buffering at https://github.com/rust-cli/anstyle/blob/59252439de0945cb93985c74858b7addae591d62/crates/anstream/src/adapter/strip.rs#L115-L144 Yes, this leverages lower level information than the |
Could you use a |
Like you should track a The state introspection is not really needed for you, since you have a Or is there something else you need? |
Depending on how the optimizer works, I'd still have the
|
Hm, I guess one option would be to make |
Like with terminated, it'll stop once you try to change state, and which basically means after every byte, except for the Though, the issue still would be that we call |
The trait currently reports a
char
at a time. While terminal emulators might need to operate onchar
s, other tools like stripping of ANSI escape codes or converting them, need to work on slices&str
->char
conversion is expensive, relatively speakingchar
would be expensiveString
to aggregate thechar
s would also be expensiveTo workaround this,
anstream
exposed the state changes from its fork,anstyle-parse
, to do this.The text was updated successfully, but these errors were encountered: