111

I'm trying to learn how to use screen, in unix so that I don't have to open up several ssh connections and terminal windows just because I want to do more than one thing at the same time on a machine. I have found the split command quite useful, but I have a problem I can't seem to figure out of... how do I unsplit??

I can split split using ^A S and switch between them using ^A ^I, but can't figure out how to remove a split...

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
Svish
  • 41,258

5 Answers5

106

ctrl-a,X doesn't work on my distribution either.

If you go into the help by pressing ctrl-a,?, you may notice that there is no remove command listed. (This is the case on my distribution, for some reason). Note that this means there is no keybinding for the command, but the command should still work using the "long form" that maxelost suggested.

Don't worry, you can still remove the current split using "long form": ctrl-a:removeenter.

In addition, you can bind the remove command to X by putting this line in your ~/.screenrc file (and then restarting screen so the changes take effect, of course):

bind X remove
Eddified
  • 1,844
46

Just use ctrlaQ (given that a is your screen-command key) to close all splits. ctrlaX closes only active window, as maxelot commented.

For example this page documents screen splitting, and other useful keys for screen.

Olli
  • 7,739
18

CTRL a + Q unsplits and lets you remain on the current window

whereas

CTRL a + X unsplits and puts you on the following available window

The first one with Q is great as you may want to remain on the current window when you need bigger space :)

Of course after that, should you need to revert to split screen, you will have to do again the CTRL a + S and CTRL a + Tab with CTRL a + Space to get back but that's ok... That would be nice if there was a way to toggle simply back and forth.

1

If you want to unsplit the currently focused split to a window, Ctrl + a + ! will do the trick (tested on OSX, or check the shortcut by running Ctrl + a + ?)

Junaid
  • 111
1

Either of the following got rid of the other window for me. This from the chapter on regions. From the Screen User's Manual.

Ctrl + a then Q

Ctrl + a then : then only

Destroy666
  • 12,350
billw
  • 11