delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/05/10/16:09:46

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding :x-gm-message-state; bh=2Lr8tvLrXAi5+HJUtm08Xy4+E1MNvBFxpUuQu0lQ5fw=; b=LiDSKNTyG1TMhWmWRN9dr8Zo1k1bt9eL1oNkWp9/Uxw5Gw0XLy/BoyeFT1WhBOxLzi 1ao0R/83dX4H++X0oIRlX0rG+FJg0h7eG4Bsyy7PNsn6pgJ26HA+brNuS+4PTRktTqD/ 4t0/Lt1qLDYxkTrBrEZIBI1fdL2Oig5MMoRfBL+GILoVara4dux9U/tOg23f8kqK8FoM 3t9WrRiYlVJWD9VgGqQHKuuFp7blnDB2OFc5ixOWIWL7qxLyRi1VIROgZ8e9c6TzNse4 85U2cxc38GWD40BeosUtizil7FtXAWkHwDCpJTTHqRsnE5EModumh2kuCCgD1tV2Km74 YL1Q==
MIME-Version: 1.0
In-Reply-To: <2BF01EB27B56CC478AD6E5A0A28931F2045DA580@A1DAL1SWPES19MB.ams.acs-inc.net>
References: <2BF01EB27B56CC478AD6E5A0A28931F2045DA580 AT A1DAL1SWPES19MB DOT ams DOT acs-inc DOT net>
From: Richard Gribble <richard AT gandalfwizard DOT us>
Date: Thu, 10 May 2012 16:08:41 -0400
Message-ID: <CAD+0NRApqrFekqiCS=o2xi=nNa4VVLHmeCo4qgDd7Y8=huKksg@mail.gmail.com>
Subject: Re: mintty suggestion
To: cygwin AT cygwin DOT com
X-Gm-Message-State: ALoCoQmicS1pPo2GknrT6EbJPa7Hfu+AoSkxS1Sm9u0BNg2oQxuppCsMN0xgT50WLjDtf2asxbQV
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q4AK9git010524

I don't know if this will resolve your problem, but I deal with long
pathnames (as a prompt) by using the following function (I set it up
as a function so that I can keep changing the prompt as I move
around):

function set_prompt
{
    if [ `pwd | sed "s|${HOME}|~|" | wc -c` -gt 15 -a \
         "/`pwd | awk -F/ '{print $(NF-1)\"/\"$NF}'`" != "`pwd` " ]
    then
        PS1=${HOSTNAME}:.../`pwd | awk -F/ '{print $(NF-1)"/"$NF}'`'->'
    else
        PS1=${HOSTNAME}:`pwd | sed "s|${HOME}|~|"`'->'
    fi
}

Pretty much it just looks at the pathname and, if it's longer than 15
characters, shortens it down to "..." and two levels.  if the
directory includes my home directory, then that is shortened to "~".

The syntax is bash.


Later,

Richard.

On Thu, May 10, 2012 at 3:34 PM, Nellis, Kenneth
<Kenneth DOT Nellis AT acs-inc DOT com> wrote:
>
> With X-Windows, one can independently set the titles of the terminal
> window and the window's icon.
>
> to set window title: ESC ] 2 ; <title> ^G
> to set icon title:   ESC ] 1 ; <title> ^G
>
> Analogously, it would be nice if Mintty would allow me to independently
> set the titles of the window and the associated taskbar button.
>
> I set my window title to $PWD, but this is typically too long for
> the taskbar button, so I'd like to be able to separately set it
> to ${PWD##*/}.
>
> --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
>

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