Bug 24159 - an alternate PROMPT_COMMAND - proposal
Summary: an alternate PROMPT_COMMAND - proposal
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-16 22:06 UTC by Michal Jaegermann
Modified: 2007-04-18 16:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-02-09 17:06:40 UTC
Embargoed:


Attachments (Terms of Use)

Description Michal Jaegermann 2001-01-16 22:06:30 UTC
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

Comment 1 Bernhard Rosenkraenzer 2001-04-24 12:33:32 UTC
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.