500

Screen has its own scroll buffer, as it is a terminal multiplexer and has to deal with several buffers. Maybe there's a better way, but I'm used to scrolling using the "copy mode" (which you can use to copy text using screen itself, although that requires the paste command too): Hit your screen prefix combination (C-a / control+A by default), then hit ...


231

The session is still attached on another terminal. The server hasn't detected the network outage on that connection: it only detects the outage when it tries to send a packet and gets an error back or no response after a timeout, but this hasn't happened yet. You're in a common situation where the client detected the outage because it tried to send some ...


164

Using the screen buffer as pointed out by njsg is a good solution. You can also disable the alternate text buffer in the xterm termcap info inside screen. When disabled you can use the scroll bars (and mouse wheel) to scroll up and down. Add this to your ~/.screenrc. # Enable mouse scrolling and scroll bar history scrolling termcapinfo xterm* ti@:te@ You ...


140

The latest version of GNU screen allows you split the window vertically without any external patches. Here is one way to get it and use it: Checkout/clone/download the source Build it in an easy sequence of ./autogen.sh, ./configure, make and install. I didn't have any problems with dependencies on Mountain Lion. To get a vertical split use: C-a | // ...


108

Try detaching it first with screen -d. If that doesn't work, you can try, in increasing order of emphasis, -d|-D [pid.tty.host] does not start screen, but detaches the elsewhere running screen session. It has the same effect as typing "C-a d" from screen's controlling terminal. -D is the equivalent to the power detach key. ...


105

Try tmux (Terminal MUltipleXer): Home Page Wikipedia And to understand the difference between session, window and pane:


87

You can use : pkill screen Or killall screen In OSX the process is called SCREEN in all caps. So, use: pkill SCREEN Or killall SCREEN


82

As screen -r says, there is one screen, but it is attached. To resume it on your current terminal, you have to detach it from the other one first: screen -d -r 27863, see manpage -d. Edit: use -d instead of -x. Edit2: @alex78191: When using -x, screen attaches to the currently running session, resulting in a "multi-display mode": you see the session on ...


80

Use Ctrl-a a, or change screen's escape keystroke (option -e).


78

Seems like your root lacks some X11 magic cookie in the .Xauthority, which your standarduser has. Here is how to fix this. SHORT VERSION (thanks to @bmaupin) standarduser@localhost:~$ xauth list | grep unix`echo $DISPLAY | cut -c10-12` > /tmp/xauth standarduser@localhost:~$ sudo su root@localhost:~$ xauth add `cat /tmp/xauth` Attention: check the ...


71

1. Tabs in screen You're looking for this to add to your .screenrc file: screen -t tab1 screen -t tab2 Here's a nice basic .screenrc to get you started with a status bar etc. NOTE: This is typically located in your home directory /home/<username>/.screenrc. screen -t validate #rtorrent screen -t compile #irssi screen -t bash3 screen -t bash4 screen ...


69

This works: command | tee -a "$log_file" tee saves input to a file (use -a to append rather than overwrite), and copies the input to standard output as well.


64

To move a process between terminals or to reattach a disowned, you can use e.g. reptyr.


63

As mentioned in the comments, besides screen, another good terminal multiplexer is tmux. You can refer to the manual for a complete description and command reference. Some basic operations to get started are: Split screen vertically: Ctrlb and Shift5 Split screen horizontally: Ctrlb and Shift" Toggle between panes: Ctrlb and o Close current pane: Ctrlb and ...


57

Start tmux as follows: (cd /aaa/bbb; tmux) Now, any new windows (or panes) you create will start in directory /aaa/bbb, regardless of the current directory of the current pane. If you want to change the default directory once tmux is up and running, use attach-session with -c. Quoting from the tmux man page for attach-session: -c will set the session ...


52

There is a screen command to do this. From the manual: Command: sessionname [name] (none) Rename the current session. Note that for screen -list the name shows up with the process-id prepended. If the argument name is omitted, the name of this session is displayed. Caution: The $STY environment variable still reflects the ...


50

Mouse scrolling and elevators will work if you enable them in your .screenrc. Screen FAQ Q: My xterm scrollbar does not work with screen. A: The problem is that xterm will not allow scrolling if the alternate text buffer is selected. The standard definitions of the termcap initialize capabilities ti and te switch to and from the alternate text ...


42

If you haven't planned ahead and setup screen, etc. just do the following: If your process is running in the background: goto #3, else: Ctrl-Z to suspend foreground process. This will report the job # of the suspended process, for example: [1]+ Stopped processName Send processName to the background with bg %1 (using whatever the job # is ...


42

You can name a session when starting it with the -S name option. From within a running screen, you can change it by typing CTRL-a, :sessionname name. You can view running screen sessions with screen -ls, and connect to one by name with screen -xS name. Within a single screen session, you can also name each window. Do this by typing CTRL-a, A then the name ...


41

There's a setting for that in screenrc: # Don't display the copyright page startup_message off # default: on You could set that system-wide (in /etc/screenrc) or in your ~/.screenrc.


41

To keep screen busy after the script completes, just keep something persistent running in a window. The simplest choice for that "something" is probably an interactive shell. Here's one way to do it (assuming bash as the choice of interactive shell): screen -dmS session_name sh -c '/share/Sys/autorun/start_udp_listeners.sh; exec bash' -dm: starts screen ...


37

after you reattach a ctrl-a F runs the "fit" command to resize the current window. if you reattach using the -A option it should resize all windows when you reattach. Are there others still attached to the screen session when you are attaching? For instance, are you having to use -x to reattach instead of -r? you can detach others when you reattach with "...


37

An easier solution: 1.- ssh user@host 2.- $ sudo su 3.- # xauth merge /home/user/.Xauthority That’s all Of course $DISPLAY variable must be set.


35

I believe what you are looking for is Ctrlb+(→, ←, ↑, ↓). Those will allow you to move between the panes.


28

My favorite solution is using tmux, you could detach the session, and re-attach it in another terminal. When you detached from previous session, you can safely close the terminal; later use tmux attach to get back to the session, even if you logged out.


27

tmux and screen have different models so there is no exact equivalent. In screen terms, a split lets you display multiple windows at the same time. next (C-a n) rotates windows through the active part of the split; this lets you rotate “hidden” windows through the active region of the split. In tmux terms, a split divides a window into one or more panes. ...


27

You cannot open /dev/pts/0 because it's owned by root, and after you su-ed into another user you're no longer able to open it via its path, but you're still able to use it via the opened handle to it, which was inherited from the parent process. script /dev/null will create another pty, owned by the current user. Anyways, that bug/limitation seems to have ...


26

All these answers addressed how to navigate within a screen session, but there is a built-in functionality in screen command to store everything in a file through the -L argument according to the manual which reads: -L tells screen to turn on automatic output logging for the windows. so you can do: screen -L -S testscreen and it will create a file ...


25

Here's my .screenrc that i use everywhere to see my screen numbers as tabs at the bottom of the window and an informational line above the tabs. The part you really need is under "look and feel". # skip the startup message startup_message off # go to home dir chdir # Automatically detach on hangup. autodetach on # Change default scrollback value for new ...


25

At least on Debian and Ubuntu, the resize command, when applied to a full height region performs a horizontal resizing. If it works for you, then first split vertically, next perform a resizing of the width, then split horizontally.


Only top voted, non community-wiki answers of a minimum length are eligible