https://github.com/theasp/bash-fancy-ps1
Make long paths in your bash prompt shorter by stripping out middle directories
https://github.com/theasp/bash-fancy-ps1
bash bash-prompt
Last synced: about 1 month ago
JSON representation
Make long paths in your bash prompt shorter by stripping out middle directories
- Host: GitHub
- URL: https://github.com/theasp/bash-fancy-ps1
- Owner: theasp
- License: gpl-2.0
- Created: 2015-09-26T13:18:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-05-17T16:43:57.000Z (about 8 years ago)
- Last Synced: 2025-02-25T05:18:03.242Z (over 1 year ago)
- Topics: bash, bash-prompt
- Language: Shell
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bash-fancy-ps1
Modifies your current `$PS1` to replace `\w` with a shorter string. Also affects `$PROMPT_COMMAND`. Run `make` to build `fancy-ps1.bash`. Put `fancy-ps1.bash` somewhere in your path, like `~/bin/`, then add this to your `~/.bashrc`:
```bash
if [ -n "$TERM" -a "$TERM" != "dumb" ]; then
if which fancy-ps1.bash >/dev/null 2>&1; then
source $(which fancy-ps1.bash)
# Try to make CWD 30 characters. Also see FANCYPS1_DYNAMIC.
# Default:
#FANCYPS1_CWDLENGTH=30
# When not 0, try to make CWD this percentage of the width of
# your terminal
# Default:
#FANCYPS1_DYNAMIC=0
# The string to fill your path with when elements are removed
# Default: (depends on if you are UTF-8 or not)
#FANCYPS1_FILL=$'\u2736' # 2736 = ✷ 279d = ➝ 2026 = …
#FANCYPS1_FILL="..."
fi
fi
```