Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suspending a process in bash running inside console2

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).

like image 468
artm Avatar asked Oct 26 '11 07:10

artm


People also ask

How do I run a process in the background in bash?

If you want to push a command into the background, using & at the end is an easy way to do that. This way, you can issue a command in the background and continue to use your terminal as it runs. It comes with a catch, though. Using & doesn't disconnect the command away from you; it just pushes it into the background.

How do I run a process in the background Shell?

Running shell command or script in background using nohup command. Another way you can run a command in the background is using the nohup command. The nohup command, short for no hang up, is a command that keeps a process running even after exiting the shell.

Which command will make process to run in background in Git bash?

The fg command switches a job running in the background into the foreground. The bg command restarts a suspended job, and runs it in the background.


2 Answers

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

like image 166
Gilles Philippart Avatar answered Nov 15 '22 19:11

Gilles Philippart


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.

like image 31
Nicholas Pufal Avatar answered Nov 15 '22 20:11

Nicholas Pufal