If I start a screen session with screen -dmS name
, how would I access the command history of that screen session with a script?
Using the ↑, the
screen
doesn't maintain a history of the commands you type. Your shell may or may not keep a history. Since you appear to use bash
, you can use the history
command.
screen
does appear to have a crude approximation of a history search (it merely searches the scrollback buffer for a command line. See the screen
man page under the "history" command (bound to C-a {
by default).