3 ms·
to clean the command prompt line after CTRL-C: trap "{ echo; exit 1; }" INT
by eik3_de 13y ago
to clean the command prompt line after CTRL-C:
trap "{ echo; exit 1; }" INT
- e12e 13y agoI don't know, if you're fearing a ctrl-c in the middle of one of those newfangled moving, colourized progress bars (hello, npm), "reset" might be more appropriate?
- eik3_de 13y agosure, if you do coloring/bold/underline/inverse in the script, reset would be appropriate. but I wouldn't do it by default, because it's quite slow ('time reset' takes 1s here)
- TorKlingberg 13y agoMy reset also takes suspiciously close to one second. Turns out it sleeps for one second at the end, probably to give the terminal time for something.
- shabble 13y ago"tputs reset" has much the same effect (I think; there are some cases I've noticed it not fully restoring things) without the delay.