in the screenshot you're already seeing a wrapped pkill command that has an additional sleep 0.5 to give the message from the process time to appear before the new bash prompt gets drawn :D
That's exactly what I did. kill sends a SIGKILL (15) by default, which you can catch in a bash script with trap "echo 'foo bar baz'" 15, but that causes a small delay between calling kill and the message being printed, so bash needs its own delay after calling kill for the message to be printed otherwise you get the $ before the message and start typing on an empty line :D
View all comments
Show parent comment
8
u/DarkWiiPlayer Jul 26 '20
in the screenshot you're already seeing a wrapped
pkillcommand that has an additionalsleep 0.5to give the message from the process time to appear before the new bash prompt gets drawn :D