Suspending a process in bash running inside console2

6.9k views Asked by At

In other terminals I would press Ctrl+z to suspend an application, often to then issue bg to send it into background.

In console2 Ctrl+z does nothing, probably because the key combination has a different meaning in Windows. But is there a way to achieve the same effect, save for 'process &'?

(I know I should use & and it works, but sometimes I would setup shell, start an editor, begin editing, then return to the console just to find that I forgot the & and I can't use the shell. It annoys me that I then have to either open a new shell and set it up again, or quit the editor, start it with & and set it up again).

3

There are 3 answers

0
Thiago Curvelo On BEST ANSWER

This annoying issue surely is a console2 bug. You may find something about at its issue tracker.

Anyway, what ctrl+z does is send a SIGSTOP signal to current process. So, you can still send that signal from another session/tab. (If it is less annoying than stop and start with &). To do that, you can use the kill command.

kill -s SIGSTOP pid

(pid is the process PID number)

Hope it helps.

2
Gilles Philippart On

In Console2, ctrl-c is bound by default to copy (text) you have to press ctrl-shift-c to cancel job.

2
Nicholas Pufal On

You could also try to remove the hotkey that is conflicting with ctrl+z.

I was having trouble using ctrl+c to cancel the execution of a script. As soon as I removed that hotkey, ctrl+c had its default restored and I was able to cancel executions properly.