Terminal – What Happens When Pressing Ctrl-T During a Running Program?

bsdosxprocessterminal

When I press Ctrl+T while some program is running in a terminal, I get some extra output, e.g.:

$ ping -q -c 100 google.com
PING google.com (172.217.16.46): 56 data bytes
load: 2.39  cmd: ping 5374 running 0.00u 0.00s
2/2 packets received (100.0%) 33.914 min / 34.169 avg / 34.423 max
...

Where does the output come from? Are there any other useful shortcuts that can be handled by a terminal?

Best Answer

On some Unix-style systems (BSDs and macOS), CtrlT sends SIGINFO to the running process. Some commands handle this directly; otherwise, it’s handled by the kernel, and that’s what produces the output you’re seeing.

SIGINFO on GNU Linux (Arch Linux) missing has more on the topic.

Related Question