huh. That's really interesting. I assume ^L is handled in the tty driver as well?
^L usually has no assigned action. $ stty -a | grep -F '^D' intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; $ stty -a | grep -F '^L' $ Your Ctrl-L clear-and-refresh command is implemented in Bash (or rather GNU readline). There is a "reprint" action, commonly bound to ^R: $ stty -a | grep rprnt eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; It doesn't clear the screen; it just issues…
What typing ^D does on Unix (2009)
21–30 of 162 posts
Re: What typing ^D does on Unix (2009)
#22Pressing enter then ~. will gracefully shutdown hung ssh sessions
Sadly it will shutdown only the 'outer' ssh session, so if you ssh to foo, and then from foo ssh to bar, and type ~. then the client->foo session is shut down but the foo->bar session is still around.
Re: What typing ^D does on Unix (2009)
#23Pressing enter then ~. will gracefully shutdown hung ssh sessions
Sadly it will shutdown only the 'outer' ssh session, so if you ssh to foo, and then from foo ssh to bar, and type ~. then the client->foo session is shut down but the foo->bar session is still around.
Re: What typing ^D does on Unix (2009)
#24Pressing enter then ~. will gracefully shutdown hung ssh sessions
For example, type ~^Z to put a session in the background.
Similarly, type ~~ to send an escape sequence in an inner session, etc...
Re: What typing ^D does on Unix (2009)
#25^U will clear the buffer - super convenient for retrying botched passwords.
I'm not sure you are speaking about readline though.
Another very useful thing I use daily is Alt-F/B, to move forward/backward in the line one word at a time. Control does the same, one letter at a time. D will delete an element instead.
Re: What typing ^D does on Unix (2009)
#26As a corollary, typing ^D twice on a non-empty line will also send EOF on the input, allowing you to provide a program with input not ending with \n from the command line. I knew about this behavior, but not why it worked, but this article's explanation clarifies this behavior as well. The first ^D terminates the read() call, passing the line so far, without terminating \n, to the program. The second causes read() to…
Re: What typing ^D does on Unix (2009)
#27Earlier quoted context omitted.
^L usually has no assigned action. $ stty -a | grep -F '^D' intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; $ stty -a | grep -F '^L' $ Your Ctrl-L clear-and-refresh command is implemented in Bash (or rather GNU readline). There is a "reprint" action, commonly bound to ^R: $ stty -a | grep rprnt eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; It doesn't clear the screen; it just issues…
And sadly ^t doesn't do the Tenex function of a snapshot of sysstat for the current process.
Re: What typing ^D does on Unix (2009)
#28Typing +++ will bring you back out to your modem's firmware, at which point you can issue further AT commands
Re: What typing ^D does on Unix (2009)
#29Typing +++ will bring you back out to your modem's firmware, at which point you can issue further AT commands
Re: What typing ^D does on Unix (2009)
#30As a corollary, typing ^D twice on a non-empty line will also send EOF on the input, allowing you to provide a program with input not ending with \n from the command line. I knew about this behavior, but not why it worked, but this article's explanation clarifies this behavior as well. The first ^D terminates the read() call, passing the line so far, without terminating \n, to the program. The second causes read() to…
I know this article says Unix specifically, but on Linux (Ubuntu) I just tried typing `ls^D` in bash and got a terminal beep. I tried in zsh and got an autocomplete as if I'd hit tab. In ksh and fish nothing happened. I'm curious as to why there are different behaviors here?