Bug 24159
| Summary: | an alternate PROMPT_COMMAND - proposal | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | Michal Jaegermann <michal> |
| Component: | bash | Assignee: | Bernhard Rosenkraenzer <bero> |
| Status: | CLOSED RAWHIDE | QA Contact: | David Lawrence <dkl> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.1 | CC: | dr |
| Target Milestone: | --- | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | i386 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2001-02-09 17:06:40 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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)
|
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