crossterm
crossterm copied to clipboard
Misleading documentation of Command::write_ansi
Documentation says:
https://github.com/crossterm-rs/crossterm/blob/769b18151c6c177d43c752cc964d2b3d058bcf14/src/command.rs#L12-L18
However, PrintStyledContent::write_ansi emits WinAPI calls, not just ANSI sequences.
https://github.com/crossterm-rs/crossterm/blob/769b18151c6c177d43c752cc964d2b3d058bcf14/src/style.rs#L387-L396
execute_fmt only executes winapi call if winapi is not supported, but since we're already inside write_ansi I think its called from queue/execute which do check for winapi before using it
Either way I think changing execute_fmt(f, SetBackgroundColor(bg)) to SetBackgroundColor(bg).write_ansi(f) is more correct , if I didn't miss anything