Nessesarius / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

The window's title disappears #281

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using mintty in cygwin and the mintty window's title disappears after (I 
guess) the /etc/profile is loaded.

The versions of the softwares utilised are:

- mintty 0.9.9

- cygwin (obtained with uname -a) CYGWIN_NT-5.1 PC-Alessandro 1.7.9(0.237/5/3) 
2011-03-29 10:10 i686 Cygwin

- Windows XP professional SP 2

I attach the /etc/profile I use, with my specifications following the standard 
ones.

Thank you

Alessandro Prosperi

Pisa (Italy)
alessandro.prosperi@gmail.com

Original issue reported on code.google.com by alessand...@gmail.com on 16 Jul 2011 at 1:52

Attachments:

GoogleCodeExporter commented 8 years ago
It's this bit in your PS1 setting that does this:

\033]0;\007

Original comment by andy.koppe on 16 Jul 2011 at 3:40

GoogleCodeExporter commented 8 years ago
Thank you, now i see the title of the window(-bash).

But...
Can the title be dynamic, reflecting the process in execution?

Really thanks for the very quick time you responded!!!

Alessandro

Original comment by alessand...@gmail.com on 16 Jul 2011 at 4:10

GoogleCodeExporter commented 8 years ago
This is a bash question rather than a mintty one, but here goes. It can be done 
using bash's "debug trap" functionality. A simple-minded solution looks like 
this:

  trap 'echo -ne "\e]0;$BASH_COMMAND\a"' debug

That has a problem though: backslash sequences in the command get expanded and 
control characters are passed straight through, both of which can mess up the 
title and have other "interesting" side effects. Hence a slightly more complex 
solution is needed, for example:

  trap 'echo -ne "\e]0;"; echo -nE "$BASH_COMMAND" | cat -t; echo -ne "\a"' debug

Original comment by andy.koppe on 16 Jul 2011 at 7:43

GoogleCodeExporter commented 8 years ago
Thanks again, Andy, but this time I think your advices are too much hard to be 
understood by me ... I don't imagine where I could insert the intriguing 
strings you suggest.

Alessandro

Original comment by alessand...@gmail.com on 17 Jul 2011 at 1:26

GoogleCodeExporter commented 8 years ago
The command can go into a bash startup file of your choice. See the manpages 
for bash, echo, and cat for the meaning of it. Please send further questions to 
the mintty discussion group or other appropriate forums.

Original comment by andy.koppe on 18 Jul 2011 at 7:12