Bug 24159 - an alternate PROMPT_COMMAND - proposal
an alternate PROMPT_COMMAND - proposal
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-16 17:06 EST by Michal Jaegermann
Modified: 2007-04-18 12:30 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-02-09 12:06:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michal Jaegermann 2001-01-16 17:06:30 EST
Here is a prompt command which eats much less of a valuable space
in window titlebars:

  PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'

If something equivalent is desired which works with older versions of
bash then more trickery is required:

        PROMPT_COMMAND='[ "${PWD}" = "${PWD#$HOME}" ] && \
        echo -ne "\033]0;${HOSTNAME%%.*}:${PWD}\007" || \
        echo -ne "\033]0;${HOSTNAME%%.*}:'"~"'${PWD#$HOME}\007"'

Tested and submitted for a consideration.

   Michal
   michal@harddata.com
Comment 1 Bernhard Rosenkraenzer 2001-04-24 08:33:32 EDT
Changed to \033]0;${USER}@${HOSTNAME%%.*}: ${PWD/$HOME/"}\007

We'd like to keep the user name in there so you can immediately see which 
sessions are su'ed.

(2.05-1)

Note You need to log in before you can comment on or make changes to this bug.