9.3 Reprinting Your Command Line with CTRL-r
You're logged in from home, running a program, and answering a prompt.
As you're almost done, modem noise prints
If your system understands the rprnt character (usually set to CTRL-r), you can ask for the command line to be reprinted as it was. In fact, you can use CTRL-r any time you want to know what the system thinks you've typed on the current line - not just when you're interrupted. But this only works in the normal cooked (41.2 ) input mode; programs like vi that do their own input processing may treat CTRL-r differently. Here's an example:
After the interruption, I just pressed CTRL-r. It reprinted the stuff I'd started typing. I finished typing and pressed RETURN to run it.
If you use a shell like the Korn shell that has interactive command editing, you can probably use it to reprint the command line, too. In bash , for example, from vi editing mode, CTRL-r still seems to start an Emacs-style reverse search. So I added this fix to my ~/.inputrc file:
# By default, ^R seems to do a "reverse-i-search", # even when not editing! Workaround: "\C-r": redraw-current-line