An open API service indexing awesome lists of open source software.

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

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
```