public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Terminal window hostname always showing
@ 2015-04-25  8:23 AC
  2015-04-30 10:58 ` Jon TURNEY
  0 siblings, 1 reply; 3+ messages in thread
From: AC @ 2015-04-25  8:23 UTC (permalink / raw)
  To: cygwin

Is it possible to turn off the automatic hostname that the window
manager is adding to terminal windows?

Right now, on any machine I log into, they all use escape sequences to
set the title of the window.  However, the window manager (not sure
which I have, looks like xorg-server) on the Cygwin system is adding a
hostname to the title.

I'm using the bash escape sequence "\u@\h: \w" which is supposed to give
me the user and the short name of the host (minus the domain) and the
path.  However, all my terminals on the Cygwin system end up like this:

user@host: ~ @host.example.com

If I change the escape sequence on the remote machine to use the full
hostname, the result on the Cygwin system is:

user@host.example.com: ~

It seems to me that the window manager is interpreting the data in the
escape sequence and opting to put a hostname on the title if it can't
find one that matches the connection.

It does the same thing if I use -T/-n on the remote xterm command.  I
end up with something like

title-used-on-command-line@host.example.com

I've verified that it's Cygwin's window manager doing it by logging in
from a regular Linux box and changing the title manually, no host name
showing up.  I'd like to stop this so the titles are what I set.

This is the data from the xserver log:

Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.16.3.0
OS: CYGWIN_NT-6.1 data2 1.7.34(0.285/5/3) 2015-02-04 12:14 x86_64
OS: Windows 7 Service Pack 1 [Windows NT 6.1 build 7601] (Win64)
Package: version 1.16.3-1 built 2014-12-30

XWin was started with the following command line:

/usr/bin/XWin :0 -multiwindow -nolisten tcp -auth



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

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

* Re: Terminal window hostname always showing
  2015-04-25  8:23 Terminal window hostname always showing AC
@ 2015-04-30 10:58 ` Jon TURNEY
  2015-04-30 18:15   ` AC
  0 siblings, 1 reply; 3+ messages in thread
From: Jon TURNEY @ 2015-04-30 10:58 UTC (permalink / raw)
  To: AC, cygwin

On 25/04/2015 09:23, AC wrote:
> Is it possible to turn off the automatic hostname that the window
> manager is adding to terminal windows?

Yes, use the X server option -nohostintitle.

> Right now, on any machine I log into, they all use escape sequences to
> set the title of the window.  However, the window manager (not sure
> which I have, looks like xorg-server) on the Cygwin system is adding a
> hostname to the title.
>
> I'm using the bash escape sequence "\u@\h: \w" which is supposed to give
> me the user and the short name of the host (minus the domain) and the
> path.  However, all my terminals on the Cygwin system end up like this:
>
> user@host: ~ @host.example.com

Thanks for pointing out this issue.

> If I change the escape sequence on the remote machine to use the full
> hostname, the result on the Cygwin system is:
>
> user@host.example.com: ~
>
> It seems to me that the window manager is interpreting the data in the
> escape sequence and opting to put a hostname on the title if it can't
> find one that matches the connection.

Almost. When -hostintitle is enabled, the WM adds the contents of 
WM_CLIENT_MACHINE to the window title, unless it already seems to be there.

I've tried to tweak this heuristic a bit in X server 1.17.1-3 so that
if WM_CLIENT_MACHINE contains something that looks like a FQDN, it only 
looks for the hostname part, not the whole thing.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

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

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

* Re: Terminal window hostname always showing
  2015-04-30 10:58 ` Jon TURNEY
@ 2015-04-30 18:15   ` AC
  0 siblings, 0 replies; 3+ messages in thread
From: AC @ 2015-04-30 18:15 UTC (permalink / raw)
  To: cygwin

Ah, thanks I had no idea that -nohostintitle existed.  I did a lot of
searching online first before submitting the question so I should have
stumbled across that at some point.  As soon as I get back to that
machine I'll add the option.

I also appreciate the heuristic tweak.  A couple other machines will
benefit from it especially where the windows are very narrow.

On 2015-04-30 03:58, Jon TURNEY wrote:
> On 25/04/2015 09:23, AC wrote:
>> Is it possible to turn off the automatic hostname that the window
>> manager is adding to terminal windows?
> 
> Yes, use the X server option -nohostintitle.
> 
[trim]
> 
> Almost. When -hostintitle is enabled, the WM adds the contents of
> WM_CLIENT_MACHINE to the window title, unless it already seems to be there.
> 
> I've tried to tweak this heuristic a bit in X server 1.17.1-3 so that
> if WM_CLIENT_MACHINE contains something that looks like a FQDN, it only
> looks for the hostname part, not the whole thing.
> 


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

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

end of thread, other threads:[~2015-04-30 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-25  8:23 Terminal window hostname always showing AC
2015-04-30 10:58 ` Jon TURNEY
2015-04-30 18:15   ` AC

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