Mail Archives: cygwin/2009/08/12/12:43:52
> I have quite a disturbing task my colleque gave to me.=20
> He uses CygWin and has up to 10 Windows opened, now he's getting tired of=
looking through every single Window when he searches for a specific one. T=
o be exact, he uses ssh to connect to our servers and wants the titlebar to=
show which server that specific window is logged on to.=20
> Is that even possible? I've gone through the web and found nothing helpfu=
l. I know that you can let the titlebar show a process name, the full path =
and i guess even the Hostname, because it is a variable, but everything i t=
ried did not show the Hostname of the server he logs on to.=20
Three possibilities:
One, tell your disturbing-and-demanding colleague (DDC for short) to set
PS1=3D'\[\033]0;\]\h\[\007\]$ '. This is hard to read, but the Bash
prompt HOWTO describes the available \-sequences for setting different
colors and information in the prompt, and for putting information into the
window titlebar.
I do this a little more clearly in the code at bottom, from my .bashrc
file.
Two, DDC could consider using screen(1) to manage all of his many sessions
in a single console window. In my .screenrc file I have
# caption bar at bottom:
caption always '%-Lw%{.kG} %n%f %t %{-}%+Lw'
and this gives a tab-like bottom row with the names of all of the windows
in the screen session, and the current window highlighted. Again this is
hard to read, but it's all fully explained in the screen info.
Three, tell DDC to go read up on PS1 and screen, and then solve his own
damn problems.
Good luck,
Andrew.
prompt_host=3D${SSH_CONNECTION:+[\\h] }
prompt_color=3D'\[\033[1;36m\]' # color of prompt ; cyan
text_color=3D'\[\033[0m\]' # color of text ; grey
start_window_title=3D'\[\033]0;\]'
end_window_title=3D'\[\007\]'
case $TERM in
# text colors and window titles:
xterm*|cygwin|screen|screen.linux)
;;
# text colors, no window titles:
linux)
start_window_title=3D'\n'
end_window_title=3D
;;
# no colors, no window titles:
*)
start_window_title=3D'\n'
end_window_title=3D
prompt_color=3D
text_color=3D
;;
esac
PS1=3D"${start_window_title}${prompt_host}\w${end_window_title}\n${prompt_c=
olor}\$${text_color}"
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -