Open nithinmuthukumar opened 1 year ago
I'm willing to help, if you could point me in the right direction
Hi @nithinmuthukumar
Could you provide your example?
I just wonder if you used color
feature? (it's often nessary in such context)
I'm encountering the same problem. What does the color feature have to do with this? Is there something i can do, besides filtering unicode characters?
It's not all characters but these 2 i found causing issues: ☀️🏛️ EDIT: I can see that tabled only prints the left side of these characters
Hi @daywalker90
Could you provide a code example?
What does the color feature have to do with this?
It was renamed to ansi
in recent releases.
But it changes the calculations a little bit.
But to be honest in this specific case, it mustn't be different.
It's not all characters but these 2 i found causing issues: ☀️🏛️
Generally speaking it all depends on a terminal. If you render the same table, which includes some obscure utf8, in different terminals it may (likely) be different.
Generally speaking it all depends on a terminal. If you render the same table, which includes some obscure utf8, in different terminals it may (likely) be different.
Now I am thinking maybe it's worth to add a configuration for it. I mean we can't fetch information from a terminal, But we could be given it.
Either a complete UTF-8 map or some specifics like this particular char will take not 1 but 3 terminal columns. Yee It could could be usefullllllllllllllllllll rarely, but would slow down rendering a fair bit. So maybe would need to be hidden by a feature.
Just thoughts here.
You are right, it's highly terminal related. With putty i have these 2 above misbehaving and with powershell it's a complete mess. (i know, windows... yikes)
pub async fn qwert(
plugin: Plugin<()>,
_args: serde_json::Value,
) -> Result<serde_json::Value, Error> {
let row1 = TableTest {
name: "test1".to_string(),
};
let row2 = TableTest {
name: "test☀️".to_string(),
};
let mut rows = Vec::new();
rows.push(row1);
rows.push(row2);
let table = Table::new(rows);
Ok(json!({ "format-hint":"simple",
"result": table.to_string() }))
}
See xterm
Characters with variable width break the table borders. Example: