Sto cercando di arrivare screena stabilire il mio xtermtitolo. Ho questo lavoro al di fuori di screen, ma screenmantiene qualsiasi titolo fosse a posto quando l'ho iniziato. Ecco il mio .bashrc:
funzione bash_prompt_command () {
# Quanti caratteri di $ PWD devono essere mantenuti
pwdmaxlen locale = 25
# Indica che c'è stato un troncamento diretto
local trunc_symbol = ".."
dir locale = $ {PWD ## * /}
pwdmaxlen = $ ((((pwdmaxlen <$ {# dir})? $ {# dir}: pwdmaxlen))
NEW_PWD = $ {PWD / # $ HOME / \ ~}
local pwdoffset = $ (($ {# NEW_PWD} - pwdmaxlen))
if [$ {pwdoffset} -gt "0"]
poi
NEW_PWD = $ {NEW_PWD: $ pwdoffset: $ pwdmaxlen}
NEW_PWD = $ {} trunc_symbol / $ {NEW_PWD # * /}
fi
esporta NEW_PWD
}
PROMPT_COMMAND = bash_prompt_command
# Color chart @ http://wiki.archlinux.org/index.php/Color_Bash_Prompt
caso "$ {TERM}" in
"Xterm")
TITLEBAR = '\ [\ 033] 0; \ u @ \ h> $ {NEW_PWD} \ 007 \]'
PS1 = "$ {TITLEBAR} \ [\ e [1; 32m \] [\ e [0; 36m \] \ u \ e [1; 32m \] @ \ e [1; 33m \] \ h \ e [ 1; 32m \]] \ e [0; 37m \] \ $ {NEW_PWD} / \ e [1; 32m \] \ $ \ [\ e [0m "
;;
"schermo")
TITLEBAR = '\ [\ 033] 0; \ u @ \ h> $ {NEW_PWD} \ 007 \]'
ESC = '\ [\ ek \ e \\\]'
PS1 = "$ {TITLEBAR} \ [\ e [1; 32m \] [\ e [0; 36m \] \ u \ e [1; 32m \]] \ e [0; 37m \] \ $ {NEW_PWD} / \ e [1; 32m \] \ $ $ {ESC} \ [\ e [0m "
;;
*)
PS1 = "\ [\ e [1; 32m \] [\ e [0; 36m \] \ u \ e [1; 32m \] @ \ e [1; 33m \] \ h \ e [1; 32m \ ]] \ e [0; 37m \] \ $ {NEW_PWD} / \ e [1; 32m \] \ $ \ [\ e [0m "
;;
esac
Ed ecco il mio .screenrc:
hardstatus alwayslastline
stringa hardstatus '% {= kg} [% {Y}% H% {g}] [% =% {= kw}%?% - Lw%?% {= b kR} (% {W}% n-% t%? (% u)%?% {= b kR})% {= kw}%?% + Lw%?%?% =% {g}] [% {Y}% l% {g}]% {g} [% {B}% m.% d.% Y% {G}% c% {g}] '
termcapinfo xterm | xterms | xs | rxvt ti @: te @
termcapinfo xterm 'hs: ts = \ E] 2;: fs = \ 007: ds = \ E] 2; schermo \ 007'
sempre acceso
shelltitle '$ | bash'
Cosa sto facendo in modo errato?
Aggiornamento (19 agosto 2010):
il problema è che non è possibile aggiornare il titolo del terminale dalla schermata durante l'impostazione alwayslastline. Quindi la mia soluzione era quella di arrendermi e accontentarmi di un titolo predeterminato, utile, per le mie sessioni sullo schermo. Il mio aggiornato .bashrce .screenrcpuò essere trovato su http://bitbucket.org/jsumners/rcfiles/src .