Open sylvestre opened 9 months ago
Is this with the gnu_legacy
feature? It may need to be fixed in nu-ansi-term itself
with nu-ansi-term
[package]
name = "test-lscolors"
version = "0.1.0"
edition = "2021"
[dependencies]
lscolors = { version = "0.16.0", features = ["nu-ansi-term"] }
So presumably these could be swapped to print the foreground first: https://github.com/nushell/nu-ansi-term/blob/f1c83ff2923d94bc1f85dca476e58fb557d44f5f/src/ansi.rs#L67-L80
This happens to work for the default GNU styles because they always put the foreground first. But really for 100% compatibility, there should be a mode that just gives you the verbatim bytes to print to the terminal without attempting to parse the escape sequences. That could be added as a separate Style-like thing maybe something like Style::to_bytes()
.
With
it returns
result = \u{1b}[44;37mfoo\u{1b}[0m
while GNU ls returns:
^[[0m^[[37;44msticky^[[0m
44 & 37 aren't in the same order.
with: