public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Title bar of X apps, no host name?
@ 2010-10-24  1:59 Jerry Cloe
  2011-11-03 19:35 ` Timothy Madden
  0 siblings, 1 reply; 8+ messages in thread
From: Jerry Cloe @ 2010-10-24  1:59 UTC (permalink / raw)
  To: 'cygwin-xfree@cygwin.com'

When I start individual windows between two linux boxes I always get the
host name in the title bar of the window.

For example from my desktop linux box:

ssh -X jerry@prodserver
then
gedit &

The title bar of the resulting gedit window will be along the lines of:
"gedit (on prodserver.host.com)"

But, when I do this from my windows/cygwin desktop, the title bar is simply
"gedit" without the host name.

On the linux side, I've never done anything to set this up or make it work,
it just always worked, so I'm not even sure where to begin looking.

Any ideas?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Title bar of X apps, no host name?
  2010-10-24  1:59 Title bar of X apps, no host name? Jerry Cloe
@ 2011-11-03 19:35 ` Timothy Madden
  2011-11-04  9:09   ` Csaba Raduly
                     ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Timothy Madden @ 2011-11-03 19:35 UTC (permalink / raw)
  To: cygwin-xfree

On 24.10.2010 04:59, Jerry Cloe wrote:
> When I start individual windows between two linux boxes I always get the
> host name in the title bar of the window.
>
> For example from my desktop linux box:
>
> ssh -X jerry@prodserver
> then
> gedit&
>
> The title bar of the resulting gedit window will be along the lines of:
> "gedit (on prodserver.host.com)"
>
> But, when I do this from my windows/cygwin desktop, the title bar is simply
> "gedit" without the host name.
>
> On the linux side, I've never done anything to set this up or make it work,
> it just always worked, so I'm not even sure where to begin looking.
>
> Any ideas?

Does anyone know how to change the window title to include the hostname 
please ?

Connecting to 4 machines (with *ssh -Y*) and starting the *gvim* on all 
of them can be really frustrating when you have no indication what 
machine each instance is running on.

Thank you,
Timothy Madden


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Title bar of X apps, no host name?
  2011-11-03 19:35 ` Timothy Madden
@ 2011-11-04  9:09   ` Csaba Raduly
  2011-11-04 11:46     ` Timothy Madden
  2011-11-04 12:28   ` Jay Goldman
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Csaba Raduly @ 2011-11-04  9:09 UTC (permalink / raw)
  To: cygwin-xfree

On Thu, Nov 3, 2011 at 8:27 PM, Timothy Madden  wrote:
>
> Does anyone know how to change the window title to include the hostname
> please ?
>

Put the following into your PS1 (on the remote machines) :

\[\e]0;\h:\w\a\]

Or you could google for "xterm window title"

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Title bar of X apps, no host name?
  2011-11-04  9:09   ` Csaba Raduly
@ 2011-11-04 11:46     ` Timothy Madden
  0 siblings, 0 replies; 8+ messages in thread
From: Timothy Madden @ 2011-11-04 11:46 UTC (permalink / raw)
  To: cygwin-xfree

On 04.11.2011 11:09, Csaba Raduly wrote:
> On Thu, Nov 3, 2011 at 8:27 PM, Timothy Madden  wrote:
>>
>> Does anyone know how to change the window title to include the hostname
>> please ?
>>
>
> Put the following into your PS1 (on the remote machines) :
>
> \[\e]0;\h:\w\a\]
>
> Or you could google for "xterm window title"

I would like to change the title of all my X windows, so as to include 
the hostname of the X client for the window (that is, the hostname 
running the application in the window).

If you connect with *ssh -Y* to several machines, than you can run GUI 
applications on those machines, and the windows will open up on your X 
desktop. If you start gvim on each of these machines, you have 4 gvim 
windows on your desktop, with no easy way to tell to which machine each 
window belongs.

Some Linux X servers have this by default (I have CentOS), and it allows 
me to run *knosole* or *gnome-terminal* or *gvim* or any other 
application on several machines at the same time, with the X windows for 
them all on my desktop, without confusing the host machine for each window.

Thank you,
Timothy Madden


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Title bar of X apps, no host name?
  2011-11-03 19:35 ` Timothy Madden
  2011-11-04  9:09   ` Csaba Raduly
@ 2011-11-04 12:28   ` Jay Goldman
  2011-11-05  9:58   ` David Sastre
  2011-11-07 18:23   ` Jon TURNEY
  3 siblings, 0 replies; 8+ messages in thread
From: Jay Goldman @ 2011-11-04 12:28 UTC (permalink / raw)
  To: cygwin-xfree


You can put what you want in the title by setting PROMPT_COMMAND - e.g., set PROMPT_COMMAND="setWindowTitle $(uname -n)"

where setWindowTitle is a shell script like:
echo -ne "\e]2;$*\a"

by putting it in the PROMPT_COMMAND you handle the case where some command sets the window title while it is processing (I do this to provide feedback for long running scripts without filling up the screen). Once the command finishes the window title gets set back to your desired value.

Btw, I use different foreground/background color combinations to distinguish between xterms on different machines - 
some of the color combinations are ugly but they are different :-)


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Title bar of X apps, no host name?
  2011-11-03 19:35 ` Timothy Madden
  2011-11-04  9:09   ` Csaba Raduly
  2011-11-04 12:28   ` Jay Goldman
@ 2011-11-05  9:58   ` David Sastre
  2011-11-07 18:23   ` Jon TURNEY
  3 siblings, 0 replies; 8+ messages in thread
From: David Sastre @ 2011-11-05  9:58 UTC (permalink / raw)
  To: cygwin-xfree

[-- Attachment #1: Type: text/plain, Size: 1595 bytes --]

On Thu, Nov 03, 2011 at 09:27:16PM +0200, Timothy Madden wrote:
> On 24.10.2010 04:59, Jerry Cloe wrote:
> >When I start individual windows between two linux boxes I always get the
> >host name in the title bar of the window.
> >
> >For example from my desktop linux box:
> >
> >ssh -X jerry@prodserver
> >then
> >gedit&
> >
> >The title bar of the resulting gedit window will be along the lines of:
> >"gedit (on prodserver.host.com)"
> >
> >But, when I do this from my windows/cygwin desktop, the title bar is simply
> >"gedit" without the host name.
> >
> >On the linux side, I've never done anything to set this up or make it work,
> >it just always worked, so I'm not even sure where to begin looking.
> >
> >Any ideas?
> 
> Does anyone know how to change the window title to include the
> hostname please ?
> 
> Connecting to 4 machines (with *ssh -Y*) and starting the *gvim* on
> all of them can be really frustrating when you have no indication
> what machine each instance is running on.

One different approach is to use 'screen' and have a hardstatus line:

hardstatus alwayslastline "%{wk}%-w%{Gk}[%n %t]%{wk}%+w%=%{Ck}%d %M %Y %c:%s"

That way, you always know which screen belongs to which host.
However, I find opening several vim in several hosts wasteful. It's
quite better to use netrw¹ to edit remote files within a single vim
instance and list your buffers to identify the files/hosts.

HTH.

¹ http://www.vim.org/scripts/script.php?script_id=1075

-- 
Huella de clave primaria: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Title bar of X apps, no host name?
  2011-11-03 19:35 ` Timothy Madden
                     ` (2 preceding siblings ...)
  2011-11-05  9:58   ` David Sastre
@ 2011-11-07 18:23   ` Jon TURNEY
  2011-12-29 17:52     ` Jon TURNEY
  3 siblings, 1 reply; 8+ messages in thread
From: Jon TURNEY @ 2011-11-07 18:23 UTC (permalink / raw)
  To: cygwin-xfree; +Cc: terminatorul, jerry

On 03/11/2011 19:27, Timothy Madden wrote:
> On 24.10.2010 04:59, Jerry Cloe wrote:
>> When I start individual windows between two linux boxes I always get the
>> host name in the title bar of the window.
>>
>> For example from my desktop linux box:
>>
>> ssh -X jerry@prodserver
>> then
>> gedit&
>>
>> The title bar of the resulting gedit window will be along the lines of:
>> "gedit (on prodserver.host.com)"
>>
>> But, when I do this from my windows/cygwin desktop, the title bar is simply
>> "gedit" without the host name.
>>
>> On the linux side, I've never done anything to set this up or make it work,
>> it just always worked, so I'm not even sure where to begin looking.
>>
>> Any ideas?
>
> Does anyone know how to change the window title to include the hostname please ?
>
> Connecting to 4 machines (with *ssh -Y*) and starting the *gvim* on all of
> them can be really frustrating when you have no indication what machine each
> instance is running on.

This is a feature of the Window Manager you are using on your linux hosts (I 
guess metacity, which appears to add the WM_CLIENT_MACHINE window property 
onto the end of the window title (if it is not the local hostname)).

Unfortunately, the integrated WM built into the Cygwin X server (which manages 
each X window as a native window in multi-window mode) doesn't have this 
feature.  I can see it would be kind of useful, but then again, I'm sure some 
people would hate it, so if added, it would need to configurable.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Title bar of X apps, no host name?
  2011-11-07 18:23   ` Jon TURNEY
@ 2011-12-29 17:52     ` Jon TURNEY
  0 siblings, 0 replies; 8+ messages in thread
From: Jon TURNEY @ 2011-12-29 17:52 UTC (permalink / raw)
  To: cygwin-xfree; +Cc: terminatorul, jerry

On 07/11/2011 18:23, Jon TURNEY wrote:
> On 03/11/2011 19:27, Timothy Madden wrote:
>> On 24.10.2010 04:59, Jerry Cloe wrote:
>>> When I start individual windows between two linux boxes I always get the
>>> host name in the title bar of the window.
>>>
>>> For example from my desktop linux box:
>>>
>>> ssh -X jerry@prodserver
>>> then
>>> gedit&
>>>
>>> The title bar of the resulting gedit window will be along the lines of:
>>> "gedit (on prodserver.host.com)"
>>>
>>> But, when I do this from my windows/cygwin desktop, the title bar is simply
>>> "gedit" without the host name.
>>>
>>> On the linux side, I've never done anything to set this up or make it work,
>>> it just always worked, so I'm not even sure where to begin looking.
>>>
>>> Any ideas?
>>
>> Does anyone know how to change the window title to include the hostname
>> please ?
>>
>> Connecting to 4 machines (with *ssh -Y*) and starting the *gvim* on all of
>> them can be really frustrating when you have no indication what machine each
>> instance is running on.
> 
> This is a feature of the Window Manager you are using on your linux hosts (I
> guess metacity, which appears to add the WM_CLIENT_MACHINE window property
> onto the end of the window title (if it is not the local hostname)).
> 
> Unfortunately, the integrated WM built into the Cygwin X server (which manages
> each X window as a native window in multi-window mode) doesn't have this
> feature.  I can see it would be kind of useful, but then again, I'm sure some
> people would hate it, so if added, it would need to configurable.

In xorg-server 1.13.1-1, which I've just uploaded, I've added support for ann
additional option '-hostintitle', on an experimental basis, which turns on the
behaviour of adding the hostname to the window title.

This option is based on the implementation in metacity when I looked a that:
the contents of the WM_CLIENT_MACHINE window property (which is typically set
by the toolkit) are added to the window title if (i) the property exists, and
(ii) it's value is not equal to the local hostname.

I'm not 100% convinced that this option is a good idea:  For example, it can
only report the host on which the X application is running, which may not be
the host with which you are interacting, e.g. if you start an xterm on host A,
and then run ssh in that xterm to host B, the window title may be something
like 'user@B (on A)', which, while technically correct, may confuse a native
user.  If host B doesn't set the window title sensibly, it's even more confusing.

There's are also probably various issues with window titles not changing
appropriately when a hostname is changed.

Also, I'm not sure about the option name.  It will get changed if something
clearer occurs to me.

Feedback welcome.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-23 19:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-24  1:59 Title bar of X apps, no host name? Jerry Cloe
2011-11-03 19:35 ` Timothy Madden
2011-11-04  9:09   ` Csaba Raduly
2011-11-04 11:46     ` Timothy Madden
2011-11-04 12:28   ` Jay Goldman
2011-11-05  9:58   ` David Sastre
2011-11-07 18:23   ` Jon TURNEY
2011-12-29 17:52     ` Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).