pol*_*ial 29
stty 负责控制这一点,您可能已经有了一个设置。您可以通过执行以下操作来检查:
$ stty -e
speed 38400 baud; 53 rows; 225 columns;
lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff -ixany imaxbel -iutf8
-ignbrk brkint -inpck ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd -hupcl -clocal -cstopb -crtscts
-dsrflow -dtrflow -mdmbuf
discard dsusp eof eol eol2 erase intr kill lnext
^O ^Y ^D <undef> <undef> ^? ^C ^U ^V
min quit reprint start status stop susp time werase
1 ^\ ^R ^Q ^@ ^S ^Z 0 ^W
Run Code Online (Sandbox Code Playgroud)
最后几行应该看起来很熟悉, ^C=intr 是您在问题中提到的那一行。您可以通过以下方式阅读如何设置更多内容:
$ man stty
Run Code Online (Sandbox Code Playgroud)
Jde*_*eBP 19
我知道在终端内,Ctrl+C键盘快捷键将向当前前台进程发送一个 SIGINT 信号。
你的知识有两点不正确:
DEL
角色或其他东西。)有没有办法设置键盘快捷键以将 SIGTERM 甚至 SIGKILL 发送到当前进程?
不。线路规则控制发送什么信号,这些信号是硬连线的。他们是(以标准的Unix) ,SIGHUP
,SIGINT
,SIGTTOU
,SIGTTIN
,SIGQUIT
和SIGTSTP
。没有其他由线路规程生成的。
Chr*_*age 18
tty 的可用信号集是SIGINT
( Ctrl+ C)、SIGTSTP
( Ctrl+ Z) 和SIGQUIT
( Ctrl+ \)。您可以为它们分配不同的字符,但这些是唯一可用的信号。出于您的目的,您可以使用Ctrl+\来发送SIGQUIT
,尽管它的行为就像一个错误,默认情况下会导致核心转储。您可以使用该stty
命令查看和更改设置。
归档时间: |
|
查看次数: |
50554 次 |
最近记录: |