why do I get Suspended (tty output) in one terminal but not in others?
This will fix it:
stty -tostop
From the man page:
tostop (-tostop)
Send (do not send) SIGTTOU for background output. This causes background jobs to stop if they attempt terminal output.
This tostop
is normally the default setting, as it's usually undesirable to mix the output of multiple jobs. So most people just want the foreground job to be able to print to the terminal.
How to resume a suspended (tty input) process [unix/mac]?
To add to the Chaitanya Bapats answer,
you can use jobs
command to list the suspended jobs. The output will be something like this if you have more than one suspended jobs.
[1] - suspended sleep 400
[2] + suspended sleep 300
You can bring the job to foreground by using fg
. If you have more than one suspended jobs, then you can use fg %ID
. ID is the value inside []
in the output of jobs
command.
Also, if you want to resume the job without bringing it to the foreground, you can use kill -CONT
command. Example usage:
kill -CONT JOBID
You can also use bg
command to move job to background. bg
will resume the last suspended job. Also, bg %ID
will resume the job with [ID]
in jobs command output
running ssh process in background gets paused
When a background process attempts to read from standard input, it is sent a signal which suspends it. This is so the user can bring the process to the foreground again and provide the necessary input.
If no input needs to be provided, you can redirect the standard input from /dev/null
, either when calling test_remote
or in cmd
.
Related Topics
Prevent Fork() from Copying Sockets
Cache Coloring on Slab Memory Management in Linux Kernel
How to Programatically Change an Executable Name (Ucmd) of a Unix Process
Restart Process on File Change in Linux
Why Is Git Creating Read-Only (444) Files
Bash: Getting Percentage from a Frequency Table
Bash Script: Can Not Properly Handle Sigtstp
How to Install Oracle 11G on Linux Without X
Output Data Register Value in Nasm
How to Use Awk to Test If a Column Value Is in Another File
Would It Be Possible to Read Out Physical Keyboard Strokes in Node.Js
Trouble Ssh Tunneling to Remote Server
Unix Cut Except Last Two Tokens
Rtnetlink Answers: No Such File or Directory
How to Manage Permissions When Developing in a Docker Container