How to resume screen?

The wording is a little unlucky – this happens because there still is a screen session attached to 14313.pts-18.b-dev03 and you cannot simply “resume” a non-detached session. You need to use the -x option in addition to attaching to this session with a second screen instance (or, alternatively, detach the existing session first): -x Attach … Read more

Strange behavior of vim color inside screen with 256 colors

Short Answer Set TERM to xterm-256color in your .bashrc, and put term screen-256color in your .screenrc. Long Answer Here’s why this breaks: gnome-terminal, screen, tmux, bash, putty and vim have all been written to intelligently handle 256 colors, but you need to set things up correctly at the earliest possible point. Using termcapinfo in your … Read more

How can I make GNU Screen start a new window at the CURRENT working directory?

See the GNU Screen chdir command. All new windows created in Screen use this as their initial directory. Using this, you can do something like: chdir /home/dan/newscreendir screen And your new window (along with any future created windows) will be in the set directory. If it’s always going to be the current working directory you … Read more

Automatically (or more easily) reconnect to a screen session after network interruption

Does the -t option do what you want? -t Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty. So: laptop> ssh -t server.com screen … Read more

Set screen-title from shellscript

You can set the screen / xterm title using the following lines: #!/bin/bash mytitle=”Some title” echo -e ‘\033k’$mytitle’\033\\’ [UPDATE] – by request I’m also including the solution proposed by @Espo below: Depending on your xterm version or your linux distribution the line above may or may not work and you can try the xterm-defaults: #!/bin/bash … Read more