2 comments

[ 3.9 ms ] story [ 17.8 ms ] thread
If you are going to adhere to the XDG Base Directory specification, please respect the XDG_CONFIG_HOME environment variable.

If you are going to use format specifiers and printf, please do so consistently. clear_line() is a mess, especially in comparison to the move_cursor() function that immediately follows it, which in turn misses out guards against option-like arguments as seen in ellipsis().

SGR 0 resets everything, to reset just colours look at SGR 39 and SGR 49.

The Bourne Again shell's internal mechanisms may be slightly more efficient than command substitution with an external seq process.

Thanks a lot for checking out the code! I addressed most of your comments.

I mostly refrain from checks like '--' or double-quoting everything when I'm sure of the input (even though shellcheck is not happy about it). For example, argument passed to move_cursor will never start with dash.

For third point, I don't see any problems with that - am I missing something? Especially when I give freedom to set any attribute (like bold, underline, etc).