Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 24159 - an alternate PROMPT_COMMAND - proposal
an alternate PROMPT_COMMAND - proposal
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
: FutureFeature
Depends On:
  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:
Last Closed: 2001-02-09 12:06:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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.

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.


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