tavianator/bfs

Terminating with SIGINT/Ctrl+C can leave terminal SGR attributes set and "corrupt" the shell prompt

Closed this issue · 1 comments

If I press Ctrl+c while bfs is printing output (e.g. when operating on a very deep file tree by accident) sometimes my shell prompt turns bold/blue after bfs terminates:

1715086654

Running printf "\033[m" or tput sgr 0 restores it back to the normal appearance, but perhaps bfs could do this automatically with a SIGINT handler? It's not a big deal, since it's easy enough to reset manually and doesn't happen often. Just an idea really.

Yeah that's a good point. I already have code like that for cleaning up the -status bar, but it should be used more generally to reset the terminal if colors are enabled.