This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: set Cygwin terminal title
- From: Duncan Roe <duncan_roe at acslink dot net dot au>
- To: cygwin at cygwin dot com
- Date: Wed, 9 Apr 2014 09:30:49 +1000
- Subject: Re: set Cygwin terminal title
- Authentication-results: sourceware.org; auth=none
- References: <CAOSUUSo-UMTJY0o5D1PBGix50NRvxmuzhTaTpqKtrOomCZBT0w at mail dot gmail dot com> <20140408145502 dot GA25569 at tastycake dot net>
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