Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I have only a single console, is it possible to simulate multiple consoles/sessions?

I'm looking for a linux command/method, not ubuntu/debian specific.

$ ..

$ console_switch 2
$ ..

#console1 again
$ console_switch 1
$ ..

Anything even like this available, even as a package?

Found package 'screen', but output isn't maintained between switching.

share|improve this question

The tmux and screen terminal multiplexers are popular for this. It is possible to see several windows at the same time by splitting vertically/horizontally; for example, Ctrl-B " in tmux. There is even possibility to copy&paste text between windows.

The emacs editor allows running interactive shells in its multiple buffers – again, with multiple buffers on screen, and with copy/paste between them.

A simpler alternative to tmux/screen is dtach, which does not perform full terminal emulation but only allows detaching/reattaching, so the previous output remains. (However, this also means that detaching inside a full-screen program will not work well.)

The Heirloom toolchest appears to provide a version of shl, "shell layers" which were present in Unix SVR3 (and died soon after, but still linger in stty swtch). I can't get the toolchest to build at all, however, and I'm not sure the modern Linux kernels have the necessary support for shl. If it worked, though, it would be almost exactly like in your example.

Finally, you can have multiple shell processes running as jobs:

$ bash
  $ suspend
$ bash
  $ suspend
$ jobs
[1]-  Stopped                 bash
[2]+  Stopped                 bash
share|improve this answer

In GNU Screen you can:

  1. split window with Ctrl+A,Shift+S,
  2. switch to the new split with Ctrl+A,Tab,
  3. open new screen with Ctrl+A,C,
  4. repeat.

Additionally to close current split press Ctrl+A,Shift+X.

share|improve this answer

GNU Screen, tmux, and probably many many more. The term that you're looking for is terminal multiplexer I think.

share|improve this answer

Not sure it's exactly what you're looking for, but screen / byobu seems similar. You don't switch with a command, but with a emacs-style key combo. If your distro has it as a package, I'd suggest byobu.

Edit: Byobu is a usability layer built on top of screen. As far as I know, their's not much that either can do that the other can't, but byobu often makes it much easier.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .