Currently, when I enter ^a : (control-A followed by ':') to send a command to GNU screen, I can go back one step in the history, and see exactly ONE previous command. This is really annoying, as I'm used to being able to go back thousands of steps in my shell history, and I'd like to be able to save at least a few dozen screen commands as well.

How can I do this?


This is actually a function of screen and, in its current release, is NOT possible--only one line of the history is stored. There was a patch posted to the mailing list some time ago, but it may not be applicable today.

Unfortunately, development on screen has slowed significantly, so if you're looking for more modern features, you may want to look at something like tmux--which is newer, but a bit more unstable than screen.

  • Thanks, I've looked at tmux, but I've got such an extensive .screenrc that I'm not looking forward to trying to port it over to tmux. Also, it doesn't yet have the killer feature: the ability to save sessions that survive a reboot. ;) – iconoclast Dec 2 '10 at 18:47
  • (Paragraph 2:) does tmux have a real command history, for commands sent to tmux (as opposed to the shell)? – iconoclast Dec 2 '10 at 18:48
  • tmux doesn't use commands in the same vein as screen. I was merely presenting an alternative that is undergoing active development, as that is more likely to see changes. :) – Andrew M. Dec 3 '10 at 2:43
  • I tested it in tmux, and it DOES allow scrolling through command history. – iconoclast Dec 29 '10 at 17:46

Take a look at this thread from last year: GNU screen loses (parts of) command histories

  • No, that refers to shell history or scroll-back buffers. The OP is asking about commands typed at screen's colon prompt. – Dennis Williamson Dec 1 '10 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.