Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
craigbarnes opened this issue May 6, 2024 · 1 comment

Comments

@craigbarnes
Copy link

craigbarnes commented May 6, 2024

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.

@tavianator
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants