-
Notifications
You must be signed in to change notification settings - Fork 30
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
Allow for OSC / Control Characters #137
Comments
Comfy-table has gained support for this behavior via a community contribution. Since this has been asked for multiple times, I moved the detailed feature-flag documentation from the Could you check whether this answers your question and whether you would have found it? I'm not sure where best to place feature flag documentation, as there's sadly no real place for it in the rust ecosystem yet. https://github.com/Nukesor/comfy-table/blob/ea2c1391d23d8f5357d2885b741c92a080672de9/README.md |
Also, if you're interested, It would be awesome if somebody that actually uses this wrote some property tests for this feature (a new property test file would make sense) :D Theres a huge amount of possible edge-cases when splitting ansi escape sequences and I really would like to see more test coverage on this :) |
ping @dsully |
Heya - I assume the feature is |
So this kind of works: The cell the OSC-8 escape codes are in are properly sized, but the header cell is not. If I remove let mut table = Table::new();
table
.load_preset("││──╞═╪╡│ ┬┴┌┐└┘")
.set_content_arrangement(ContentArrangement::Dynamic)
.set_header(
vec![
"Version",
"Revision",
"Branch",
"Published",
"Deprecated",
"State",
"Flags",
"Deprecated By",
]
.iter()
.map(|&title| Cell::new(title))
.collect::<Vec<_>>(),
); fn hyperlink(url: &str, text: &str) -> String {
format!("\x1B]8;;{url}\x1B\\{text}\x1B]8;;\x1B\\")
.yellow()
.underline(Color::Yellow)
.to_string()
} Any thoughts here? |
Ook. Since I didn't write this and have never used this, I didn't know the full capabilities of that logic. I kind of expected OSC to work just fine, however it seems that this hasn't been implemented yet. Would you mind investigating and extending that logic? All current logic is gated behind the Original ANSI issue: |
I looked at it a bit yesterday. I'll try and find time this week to dig deeper. Is the cell width calculator behind that flag as well? |
Yep. That should be the Depending on where this should be handled, this is something that might need to be added to the |
PR above. |
A detailed description of the feature you would like to see added.
Hi - I'd like to include OSC-8 hyperlinks in various columns - unfortunately that causes the column (and table) width to be incorrectly calculated.
Explain your usecase of the requested feature
See above.
Here's an example OSC-8 sequence:
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: