delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/07/31/11:00:47

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <1299EF3181B10F479D85C328013285240331C4C9@THEZE.intra.cea.fr>
References: <1299EF3181B10F479D85C328013285240331C4C9 AT THEZE DOT intra DOT cea DOT fr>
Date: Sat, 31 Jul 2010 16:00:37 +0100
Message-ID: <AANLkTi=dZYPWe-074wi43+WADkL8cb8t20iGM2FK=i1v@mail.gmail.com>
Subject: Re: Window shortcut to launch a Mintty login bash on a given directory
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 31 July 2010 14:45, JOHNER Jean 066030 wrote:
> The last problem is that the window title, for the "My documents/foobar"
> directory becomes:
> /cygdrive/d/Documents and settings/User_name/My documents/foobar
> which iconifies to "/cygdrive/d/Docu...", the latter indication being
> the same for all directories.
>
> I tried:
> C:\cygwin\bin\mintty.exe -t foobar -e /bin/env CHERE_INVOKING=1
> /bin/bash --login
>
> to get the "foobar" window title, but at the end the complete above
> title comes back again.

The window title is changed to the working directory as part of the
shell prompt, i.e. the PS1 variable, which is set in /etc/profile.
It's the initial part of it that does it:

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

So you could change PS1 to something more to your liking in ~/.bash_profile.

Alternatively, you could mount (part of) the "D:/Documents and
settings/User_name/My documents/foobar" path to a shorter POSIX path
in /etc/fstab or /etc/fstab.d/$USER. See
http://cygwin.com/1.7/cygwin-ug-net/using.html#mount-table for
details.

You might also want to consider making it your official home
directory, in which case it would be abbreviated to a tilde in the
title.

(This isn't mintty-specific of course.)

Andy

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019