public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* set Cygwin terminal title
@ 2014-04-08 14:24 xmoon 2000
  2014-04-08 14:55 ` Adam Dinwoodie
  2014-04-08 16:24 ` Nellis, Kenneth
  0 siblings, 2 replies; 7+ messages in thread
From: xmoon 2000 @ 2014-04-08 14:24 UTC (permalink / raw)
  To: cygwin

Ho can I set Cygwin termnal title?

I have tried echoing every escape sequence I have found on web.

None seem to work.

--
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] 7+ messages in thread

* Re: set Cygwin terminal title
  2014-04-08 14:24 set Cygwin terminal title xmoon 2000
@ 2014-04-08 14:55 ` Adam Dinwoodie
  2014-04-08 23:31   ` Duncan Roe
  2014-04-09  7:37   ` Csaba Raduly
  2014-04-08 16:24 ` Nellis, Kenneth
  1 sibling, 2 replies; 7+ messages in thread
From: Adam Dinwoodie @ 2014-04-08 14:55 UTC (permalink / raw)
  To: cygwin

On Tue, Apr 08, 2014 at 03:24:29PM +0100, xmoon 2000 wrote:
> Ho can I set Cygwin termnal title?
> 
> I have tried echoing every escape sequence I have found on web.
> 
> None seem to work.

It's reasonably likely your `$PS1` includes a line to set the terminal
title; I think the default Cygwin Bash profile files do that.  If that's
the case, an escape sequence command to set the terminal title will
work, but will then be immediately reset by the Bash prompt being
displayed.

To check, run `echo "$PS1"` and see if that includes a bunch of escape
sequences.  If it does, to change that behaviour you'll need to work out
which file is setting `$PS1` and fix it.  It'll probably be one of
`~/.bashrc`, `~/.profile` or `~/.bash_profile`.

If that doesn't get you anywhere, read through the below, including the
link on how to ask smart questions.  You've really not given us much to
go on to help you.

> Problem reports:       http://cygwin.com/problems.html

--
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] 7+ messages in thread

* RE: set Cygwin terminal title
  2014-04-08 14:24 set Cygwin terminal title xmoon 2000
  2014-04-08 14:55 ` Adam Dinwoodie
@ 2014-04-08 16:24 ` Nellis, Kenneth
  1 sibling, 0 replies; 7+ messages in thread
From: Nellis, Kenneth @ 2014-04-08 16:24 UTC (permalink / raw)
  To: cygwin

From: xmoon 2000 
> Ho can I set Cygwin termnal title?
> 
> I have tried echoing every escape sequence I have found on web.
> 
> None seem to work.

This works with mintty and bash:

printf "\e]2;%s\a" "your message here"

--Ken Nellis


--
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] 7+ messages in thread

* Re: set Cygwin terminal title
  2014-04-08 14:55 ` Adam Dinwoodie
@ 2014-04-08 23:31   ` Duncan Roe
  2014-04-09  7:37   ` Csaba Raduly
  1 sibling, 0 replies; 7+ messages in thread
From: Duncan Roe @ 2014-04-08 23:31 UTC (permalink / raw)
  To: cygwin

On Tue, Apr 08, 2014 at 03:55:02PM +0100, Adam Dinwoodie wrote:
> On Tue, Apr 08, 2014 at 03:24:29PM +0100, xmoon 2000 wrote:
> > Ho can I set Cygwin termnal title?
> >
> > I have tried echoing every escape sequence I have found on web.
> >
> > None seem to work.
>
> It's reasonably likely your `$PS1` includes a line to set the terminal
> title; I think the default Cygwin Bash profile files do that.  If that's
> the case, an escape sequence command to set the terminal title will
> work, but will then be immediately reset by the Bash prompt being
> displayed.
>
> To check, run `echo "$PS1"` and see if that includes a bunch of escape
> sequences.  If it does, to change that behaviour you'll need to work out
> which file is setting `$PS1` and fix it.  It'll probably be one of
> `~/.bashrc`, `~/.profile` or `~/.bash_profile`.
>
> If that doesn't get you anywhere, read through the below, including the
> link on how to ask smart questions.  You've really not given us much to
> go on to help you.
>
I have this in my .bashrc

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD/#$HOME/~}\007"'

A bit extravegant to issue after every command I suppose, but it works,

Cheers ... Duncan.

--
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] 7+ messages in thread

* Re: set Cygwin terminal title
  2014-04-08 14:55 ` Adam Dinwoodie
  2014-04-08 23:31   ` Duncan Roe
@ 2014-04-09  7:37   ` Csaba Raduly
  2014-04-09  8:25     ` xmoon 2000
  1 sibling, 1 reply; 7+ messages in thread
From: Csaba Raduly @ 2014-04-09  7:37 UTC (permalink / raw)
  To: cygwin list

On Tue, Apr 8, 2014 at 4:55 PM, Adam Dinwoodie  wrote:
> On Tue, Apr 08, 2014 at 03:24:29PM +0100, xmoon 2000 wrote:
>> Ho can I set Cygwin termnal title?
>>
>> I have tried echoing every escape sequence I have found on web.
>>
>> None seem to work.
>
> It's reasonably likely your `$PS1` includes a line to set the terminal
> title; I think the default Cygwin Bash profile files do that.  If that's
> the case, an escape sequence command to set the terminal title will
> work, but will then be immediately reset by the Bash prompt being
> displayed.

xmoon, if you are experimenting with setting the terminal title and
indeed PS1 is resetting it, try putting a sleep command after the
title-setting echo:

echo -ne "\033]2;I am ${USER}@${HOSTNAME} at ${PWD}\007"; sleep 3

Now you can admire the new title for three seconds.

Csaba, whose echo $PS1 says
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$
-- 
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

--
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] 7+ messages in thread

* Re: set Cygwin terminal title
  2014-04-09  7:37   ` Csaba Raduly
@ 2014-04-09  8:25     ` xmoon 2000
  2014-04-10  7:32       ` Csaba Raduly
  0 siblings, 1 reply; 7+ messages in thread
From: xmoon 2000 @ 2014-04-09  8:25 UTC (permalink / raw)
  To: cygwin

@Csaba   Yes - that works.

Actually that's a big help - because within my looping bash script
that is keeping the window title up/changing until scripts stops .
Which is perfect.

thanks you

On 9 April 2014 08:37, Csaba Raduly <rcsaba@gmail.com> wrote:
> On Tue, Apr 8, 2014 at 4:55 PM, Adam Dinwoodie  wrote:
>> On Tue, Apr 08, 2014 at 03:24:29PM +0100, xmoon 2000 wrote:
>>> Ho can I set Cygwin termnal title?
>>>
>>> I have tried echoing every escape sequence I have found on web.
>>>
>>> None seem to work.
>>
>> It's reasonably likely your `$PS1` includes a line to set the terminal
>> title; I think the default Cygwin Bash profile files do that.  If that's
>> the case, an escape sequence command to set the terminal title will
>> work, but will then be immediately reset by the Bash prompt being
>> displayed.
>
> xmoon, if you are experimenting with setting the terminal title and
> indeed PS1 is resetting it, try putting a sleep command after the
> title-setting echo:
>
> echo -ne "\033]2;I am ${USER}@${HOSTNAME} at ${PWD}\007"; sleep 3
>
> Now you can admire the new title for three seconds.
>
> Csaba, whose echo $PS1 says
> \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$
> --
> 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
>
> --
> 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
>

--
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] 7+ messages in thread

* Re: set Cygwin terminal title
  2014-04-09  8:25     ` xmoon 2000
@ 2014-04-10  7:32       ` Csaba Raduly
  0 siblings, 0 replies; 7+ messages in thread
From: Csaba Raduly @ 2014-04-10  7:32 UTC (permalink / raw)
  To: cygwin list

Hi xmoon,

Please don't top-post (http://cygwin.com/acronyms/#TOFU)

On Wed, Apr 9, 2014 at 10:25 AM, xmoon 2000  wrote:
> @Csaba   Yes - that works.
>
> Actually that's a big help - because within my looping bash script
> that is keeping the window title up/changing until scripts stops .
> Which is perfect.

When you have a long-running script, you don't need to call sleep; you
can set the title and then run the script. When the script ends, the
title will be reset by PS1.

A more permanent solution could be this script:
http://www.twistedmatrix.com/users/glyph/preexec.bash.txt

It will change the terminal title to the running command without you
having to explicitly set it.

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

--
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] 7+ messages in thread

end of thread, other threads:[~2014-04-10  7:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-08 14:24 set Cygwin terminal title xmoon 2000
2014-04-08 14:55 ` Adam Dinwoodie
2014-04-08 23:31   ` Duncan Roe
2014-04-09  7:37   ` Csaba Raduly
2014-04-09  8:25     ` xmoon 2000
2014-04-10  7:32       ` Csaba Raduly
2014-04-08 16:24 ` Nellis, Kenneth

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