delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/12/12:43:52

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
From: Andrew Schulman <schulman DOT andrew AT epamail DOT epa DOT gov>
To: cygwin AT cygwin DOT com
Subject: Re: Issue with the titlebar
Date: Wed, 12 Aug 2009 12:43:31 -0400
Message-ID: <v4s5851be7fo5526im82ijjqa4agvf8b39@4ax.com>
References: <20090812155808 DOT 311470 AT gmx DOT net>
In-Reply-To: <20090812155808.311470@gmx.net>
MIME-Version: 1.0
X-Archive: encrypt
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019