Relationship between ASCII control codes and Process Signals
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Relationship between ASCII control codes and Process Signals
Hello,
Say you are running bash and are managing jobs with Ctrl Z, Ctrl D, Ctrl |, etc., or send a backspace as Ctrl H, etc. etc. These are ASCII control codes in the 0 - 31 range that bash picks up.
My question: Are these mapped directly to standard POSIX process signals like SIGKILL, SIGTERM, etc? If so, is there a comprehensive listing some place of how each ASCII control character correlates to the corresponding POSIX process signal?
Stated another way, are ASCII control codes in bash more or less "hotkeys" for various signals you could send to PIDS via kill?
Any illuminating information would be appreciated -- I understand the signals and the codes, just not how they relate to eachother.
No - the mapping is done per terminal session though of course there are defaults.
You can run "stty -a" to see a lot of these.
Other capabilities are related to terminfo. If you do "echo $TERM" you'll see your session has a defined terminal type (often xterm or vt100 for most things these days since you're usually emulating a physical terminal - in the old days you were usually on a physical serial terminal of one sort or another). You can dump the terminfo information with the infocmp command. (e.g. infocmp xterm).
For most commands there are man(ual) pages that can be accessed by typing man <command> (e.g. man infocmp, man stty). Also for many configuration files there are man pages (e.g. man terminfo).
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Only Control-C, Control-\ and Control-Z (and perhaps a couple more) are related to signals. The other control characters are used to send instructions to the terminal driver, like ringing a bell, tab, backspace, newline, end-of-file, suspend/resume output, page-feed, escape and the likes but this isn't done by sending signals which would be overkill.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.