From d72851316b4bfb4c3ff56030cefb621df51a5b90 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 27 Nov 2008 15:32:12 +0000 Subject: [PATCH] Many screen tweaks including screen-256color termcap, white caption and hardstatus with clock. Fix for prompt command inside screen. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@158 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .profile.d/prompt.bashrc | 6 +++- .screenrc | 64 +++++++++++++++++++++++++++++++++++++++- .terminfo/s/screen-256color | Bin 0 -> 1828 bytes .terminfo/s/screen-256color-bce | Bin 0 -> 1840 bytes 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 .terminfo/s/screen-256color create mode 100644 .terminfo/s/screen-256color-bce diff --git a/.profile.d/prompt.bashrc b/.profile.d/prompt.bashrc index f874d59..cf133c7 100644 --- a/.profile.d/prompt.bashrc +++ b/.profile.d/prompt.bashrc @@ -28,5 +28,9 @@ if ps -o comm= -p $PPID 2>/dev/null | grep '^vim*$' &>/dev/null; then info="$info$vimchild" fi blank=$(echo "$info" | sed 's/./ /g') -export PROMPT_COMMAND="echo -ne '\033]0;$info\007\r$blank \r'" +if [ "${TERM##screen}" = "$TERM" ]; then + export PROMPT_COMMAND="echo -ne '\033]0;$info\007\r$blank \r'" +else + export PROMPT_COMMAND='echo -ne "\033k\033\\"' +fi unset blank info vimchild SSH_FORWARDED diff --git a/.screenrc b/.screenrc index 9b6a296..ba46de2 100644 --- a/.screenrc +++ b/.screenrc @@ -1,13 +1,75 @@ # $Id$ + +# Use Control-P instead of Control-A for stuff. escape ^pp + +# Turn off annoyances. vbell off startup_message off -caption always "%?%F%{= gw}%:%{=b wk}%?%-Lw%50>%?%F%{+b}%:%{-b}%?[%n%f %t]%?%F%{-b}%:%{=b wk}%?%+Lw%<" + +################################################################################ +# Hotkeys. +################################################################################ +# Up and down like Vim. bind j focus down bind k focus up +# Close the current window. +bind q remove +# Set current window title. bind t title #bind h focus top #bind l focus bottom + +################################################################################ +# Terminal settings. +################################################################################ +# How to set the foreground and background colours. termcapinfo putty*|rxvt-unicode|xterm* 'AB=\E[48;5;%dm:AF=\E[38;5;%dm' +# How to set the hardstatus line (ie title bar). Even though we don't use it. +termcapinfo xterm* 'ts=\E]0;:fs=\007:ds=\E]0;\007' +# Allow PgUp/PgDn to work correctly. termcapinfo * 'ti@:te@' +# Support 256 colours with background clear erase. +term screen-256color-bce +# Turn on background clear erase. defbce on + +################################################################################ +# Caption settings. +################################################################################ +# Display hardstatus on the bottom of the screen instead of in the title bar. +hardstatus alwayslastline +# The string is white on blue text showing: hostname, current window, date. +hardstatus string "%{= BW}%H [screen %n: %t]%<%=%Y-%m-%d %0c:%s" +# Show a caption bar for every window even if there are no splits. +caption always +# Format a caption string depending on whether it is related to the active +# window or not (%?%Fxxx%:yyy%? shows xxx if the window is active and yyy +# otherwise). +# The caption consists of a white background bar. The active window has +# a blue marker at either end and the text is blue. Inactive windows have +# black text. All windows show the name of all windows with the current one +# highlighted in square brackets. +caption string "%?%F%{= BW}%:%{= ww}%?>%?%F%{= wb}%:%{= wk}%?%-Lw%50>%{+b}[%n%f %t]%{-b}%+Lw%<%=%?%F%{= BW}%:%{ ww}%?<" +# %?%F%{= BW}%:%{= ww}%?> +# Show the > marker in white on blue if the window is active or white on white +# (ie hidden) if the window is inactve. +# +# %?%F%{= wb}%:%{= wk}%? +# Show everything in blue on white if the window is active or black on white +# if the window is inactive. +# +# %-Lw%50> +# Left-aligned window list up to but not including the active window. +# +# %{+b}[%n%f%t]%{+b} +# Show name, flags and title in bold. +# +# %+Lw +# All remaining window names. +# +# %<%= +# Truncate here then pad remaining text. +# +# %?%F{= BW}%:%{ ww}%?< +# Show the < marker in the same way as the previous. diff --git a/.terminfo/s/screen-256color b/.terminfo/s/screen-256color new file mode 100644 index 0000000000000000000000000000000000000000..0c13020fa265c01c50524e90398852b647663c9f GIT binary patch literal 1828 zcmcgsJ8WBJ6#jm>06Rln;m>s*lyD>aO~g z{P#U|(d-YXpNu`a(okO{8E=pBX#LaU>Dci9v{Lpzt~1GTe?PqgKhaDxy}e$JeG;>Z z*Kh#O!z${kZaI1()Gb#pv?+K?gbAzo2Hgdk_`aeEJSP>j5jUvwv)~xNVxkK9d006k z)rkdK4u^?BgWw2^IJTdWN?#x)k|*FdaD=WQU}|InU%)kamjxC#cgm(Tg*!y=Hmv+P znylkG61_>Aq0Lfp0xCr(WiV|pBk0X3R7 zbxHk*dZej{`lNvl8&aInox{3(M2D~@a1inM&`=_A`m}A&&CSm*E-o!qD%I-pa;;Xc zHyX|6%1Wzs<3_u^y4vZit*x(bY}~wg>(=Jx*4Fm+&dzOV$u(Ff&qY1=C3dCfMb~gg z{vTc@^fU7QOgqemx6(WMjP7{m;JPes%Sjq7V*=(AdO?@HbQpwDRVY(L=j{#mA2Zys z`^Niy;}PRceH<>{Gxz=efA7vG`8Em#a!WoQW968MLmVX;% zRMA8m>%86B8Jg^ geWiy~3Nx3f5XomIMZZ)KBbj$myYA3D)JiV?0jp7LPXGV_ literal 0 HcmV?d00001 diff --git a/.terminfo/s/screen-256color-bce b/.terminfo/s/screen-256color-bce new file mode 100644 index 0000000000000000000000000000000000000000..eecfdbd72a516057a8e3fd6553f3ffd09f3be641 GIT binary patch literal 1840 zcmcgsJ8WBJ6#jm4#jBCUHnY1_q=`3=9Z?Ds^IFLYVLT*QsiyLxn1?e7^IY@0|a2 zuJ7Nc66nWqRMh>*TCr6sHDYcMFRs>BTd{>=X=i-;VszH%(alP`9Az?UvTM=##$t42 zbPQ1DCyvCRF!MZ$!ek!L;{-ZSc%V9W4sggpJja?>aS|G*O=S#&IEM_*Gs@x$@fzl^ zgcXx*pow*C8UC)p_wWHeCi@(B@df>t_zGX+8d8hLue!|cA z1;65VJj9>)3x6Y`4yjJ(2<^CfS@qG&b5gyo-stjB=|z{hKn<#Kl_$HR7F3nKy>G;> zQ9dMoq&`ufsk`bo@;~;~g|k1Pek$_#N&`KSWW0UKT*V>02&gKCQMj`x9QH)#P<|U;039m4Y@&$ zp9RPGWfPUjM`2}+R3qkTSsWz>b%G->3NS=US$1%FPfT@uQd;!`UGDl^)8 zNH^oUopy9us6*<7)Ft&p>X9Zw>XQaKU6%6M0*BGxKQIuBojGIMb93|a zOH0ek<#MI6vQn+qYV~@fvAWu9-nh|ft*y1&>+2gEo0~Up-nzB5wY|Nwv%7m+T5=WE zsgbbfzQnHdyx(yy^Sl zAc3QC)Co9;!tb{{pcpZ}0#B literal 0 HcmV?d00001 -- 2.7.4