X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.screenrc;h=279a1204662c7f8e404802bc9e448b53ad9a309a;hp=5e0864d38573288b49de166857ff3aa8207256a8;hb=HEAD;hpb=a54c1db8888e03844c9e07acb28f0b52b2f7d61f diff --git a/.screenrc b/.screenrc index 5e0864d..a085862 100644 --- a/.screenrc +++ b/.screenrc @@ -1,117 +1,125 @@ -# detach on hangup -autodetach on +# Allow virtual alternate screen +altscreen on -# status line at the bottom of terminal -# display numbers and titles: -# for inactive windows with default color (presumably black) on cyan -# for active windows with blue on cyan -caption always "%{= cd}%-w%{= cb}%n %t%{-}%+w %-=" - -deflogin on - -# set every new windows hardstatus line to somenthing descriptive -# defhstatus "screen: ^E (^Et)" - -defscrollback 1000 - -# emulate .logout message -pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." - -# make the shell in every window a login shell -shell -$SHELL - -# shelltitle '> |bash' -# shelltitle '$ |sh' -# shelltitle '# |root sh' +#autodetach off # don't display the copyright page startup_message off +#nethack on -# no annoying audible bell, please -#vbell on - -# don't kill window after the process died -# zombie "^[" - -################ -# -# xterm tweaks -# - -# advertise hardstatus support to $TERMCAP -# termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\' +#defflow on # will force screen to process ^S/^Q -# do not confuse Solaris :) -#term vt100 +# make the shell in every window a login shell +deflogin on +shell -$SHELL -# xterm understands both im/ic and doesn't have a status line. -# note: do not specify im and ic in the real termcap/info file as -# some programs (e.g. vi) will not work anymore. -#termcap xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l -#terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l +# For this to work PS1 prompt must include empty "k\" sequence +# and ends with "$ ". +#shelltitle "\$ |$SHELL" +#bind R screen -t '# |root:' sudo su - -# 80/132 column switching must be enabled for ^AW to work -# change init sequence to not switch width -#termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l +# define a bigger scrollback, default is 100 lines +defscrollback 1024 -# make the output buffer large for (fast) xterms. -#termcapinfo xterm* OL=10000 +# emulate .logout message +pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." -# tell screen that xterm can switch to dark background and has function keys -#termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l' -#termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~' -#termcapinfo xterm 'kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:kP=\E[H:kN=\E[6~' +# ------------------------------------------------------------------------------ +# SCREEN KEYBINDINGS +# ------------------------------------------------------------------------------ -# special xterm hardstatus: use the window title. -#termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]0;screen\007' +# Remove some stupid / dangerous key bindings +bind ^k +#bind L +bind ^\ -# our xterm has colors! (rxvt, too) -#termcap xterm 'AF=\E[3%dm:AB=\E[4%dm' -#terminfo xterm 'AF=\E[3%p1%dm:AB=\E[4%p1%dm' +# 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" -#terminfo xterm 'vb=\E[?5h$<200/>\E[?5l' -#termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l' +# 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%<" -# emulate part of the 'K' charset -#termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337' +# 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 %-=" -################ -# -# other terminals -# +caption always "%{= yk}%-w%{= gk}%n%f %t%{-}%+w %-=" -# extend the vt100 desciption by some sequences. -#termcap vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC -#terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC +# set these terminals up to be 'optimal' instead of vt100 +termcapinfo xterm*|rxvt*|linux*|Eterm* OP -# https://savannah.gnu.org/bugs/?14930 -#termcapinfo linux|xterm|rxvt|xterm-color ti@:te@:XT +# 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' -################ -# -# keybindings +# 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@ -# remove some stupid / dangerous key bindings -bind h -bind ^h -bind k -bind ^k -bind z -bind ^z -bind . -bind \\ -bind ^\ -# make them better -#bind 'I' login on -#bind 'O' login off +# 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' -# yet another hack: -# prepend/append register [/] to the paste if ^a^] is pressed. -# this lets me have autoindent mode in vi. -#register [ "\033:se noai\015a" -#register ] "\033:se ai\015a" -#bind ^] paste [.] +# Do not use the alternate screen at all +# run `tput smcup; screen; tput rmcup` +termcapinfo xterm*|rxvt* 'ti=:te=' -# on backspace send ^H -bindkey -d -k kb stuff "\010" +# Enable non-blocking mode to better cope with flaky ssh connections. +defnonblock 5