gnome-terminal/bash: How to cancel inserted commands that will be executed later?

3

$ execute_some_long_command
<command is executing>
<Accidently press middle button that inserts bunch of garbage (including, for example, `rm -Rf ~/*`) into console>

How to let execute_some_long_command finish, but not execute inserted things?

Vi.

Posted 2011-03-13T02:42:53.130

Reputation: 13 705

Answers

4

Type Ctrl+Z (goes back to prompt, doesn't execute keyboard buffer) and then fg to get the running execute_some_long_command back on track.

At least that worked in my Fedora 14 gnome-terminal, testing with sleep 20 as execute_some_long_command and echo blah as the typed garbage.

JCCyC

Posted 2011-03-13T02:42:53.130

Reputation: 2 143