# Allow virtual alternate screen altscreen on #autodetach off # don't display the copyright page startup_message off #nethack on #defflow on # will force screen to process ^S/^Q # make the shell in every window a login shell deflogin on shell -$SHELL # For this to work PS1 prompt must include empty "k\" sequence # and ends with "$ ". #shelltitle "\$ |$SHELL" #bind R screen -t '# |root:' sudo su - # define a bigger scrollback, default is 100 lines defscrollback 1024 # emulate .logout message pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." # ------------------------------------------------------------------------------ # SCREEN KEYBINDINGS # ------------------------------------------------------------------------------ # Remove some stupid / dangerous key bindings bind ^k #bind L bind ^\ # An example of a "screen scraper" which will launch urlview on the current # screen window # #bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview" # on backspace send ^H #bindkey -d -k kb stuff "\010" # Remap keypad #KP_Home bindkey \033Ow stuff \033[1~ #KP_Up bindkey \033Ox stuff \033OA #KP_PgUp bindkey \033Oy stuff \033[5~ #KP_Left bindkey \033Ot stuff \033OD #KP_Right bindkey \033Ov stuff \033OC #KP_End bindkey \033Oq stuff \033[4~ #KP_Down bindkey \033Or stuff \033OB #KP_PgDn bindkey \033Os stuff \033[6~ #KP_minus bindkey \033Om stuff - #KP_plus bindkey \033Ok stuff + #KP_slash bindkey \033Oo stuff / #KP_asterisk bindkey \033Oj stuff * #KP_Enter bindkey \033OM stuff \015 # ------------------------------------------------------------------------------ # TERMINAL SETTINGS # ------------------------------------------------------------------------------ # The vt100 description does not mention "dl". *sigh* termcapinfo vt100 dl=5\E[M # turn sending of screen messages to hardstatus off hardstatus off # Set the hardstatus prop on gui terms to set the titlebar/icon title termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007 # use this for the hard status string #hardstatus string "%h%? users: %u%?" # An alternative hardstatus to display a bar at the bottom listing the # windownames and highlighting the current windowname in blue. (This is only # enabled if there is no hardstatus setting for your terminal) # #hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<" # status line at the bottom of terminal # display window number, flags and title # for inactive windows - black on yellow (brown) # for active window - black on green #hardstatus alwayslastline #hardstatus string "%{= yk}%-w%{= gk}%n%f %t%{-}%+w %-=" caption always "%{= yk}%-w%{= gk}%n%f %t%{-}%+w %-=" # set these terminals up to be 'optimal' instead of vt100 termcapinfo xterm*|rxvt*|linux*|Eterm* OP # Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E> # (This fixes the "Aborted because of window size change" konsole symptoms found # in bug #134198) termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' # To get screen to add lines to xterm's scrollback buffer, uncomment the # following termcapinfo line which tells xterm to use the normal screen buffer # (which has scrollback), not the alternate screen buffer. # #termcapinfo xterm*|rxvt* ti@:te@ # Use the alternate screen of the xterm-like terminal # https://unix.stackexchange.com/a/261939 #termcapinfo xterm* 'ti=\E[?1049h:te=\E[?1049l' #termcapinfo rxvt* 'ti=\E7\E[?47h:te=\E[2J\E[?47l\E8' # Do not use the alternate screen at all # run `tput smcup; screen; tput rmcup` termcapinfo xterm*|rxvt* 'ti=:te=' # Enable non-blocking mode to better cope with flaky ssh connections. defnonblock 5