7 ms·
why is this so astounding to those commenting on twitter? because git doesn't artificially limit the line length? i've used ansi sequences in my zsh prompt for
by invsblduck 5y ago
why is this so astounding to those commenting on twitter? because git doesn't artificially limit the line length?
i've used ansi sequences in my zsh prompt for 20 years to make colors and move the cursor; it's just in-band ascii that is interpreted by the terminal emulator, no?
- danielheath 5y agoBy default, I'd expect data that likely came from third parties to be sanitized before output.
- enriquto 5y agoSure, sure, but why would such a sanitization remove useful things like terminal drawing codes? That would be untoward.
- theamk 5y agoit was, note the twitter had you pass "--no-pager" to get cursor movement to work. With default options, you only get colors, and this is pretty safe.
- ryan-c 5y agoIt's a bit more complicated than that. For example, if you do git log --format=%ae | sort -u the cursor movement sequences will be preserved. I haven't delved too deeply into what git actually does here in terms of processing for "pager" output vs not.
- ryan-c 5y ago...and for this "display some art" hack specifically, it looked like it can be made to work with plain git log by using `\r` characters as newlines in addition to the escape sequences, but I haven't tested that much.