diff options
| author | Syndamia <kamen@syndamia.com> | 2025-03-01 12:20:00 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-03-01 12:20:00 +0200 |
| commit | e406848e48b4bef66572d94feead19a4f382a561 (patch) | |
| tree | b3daeea448c21a940a5f1335016d5be2f73a6912 /.bashrc | |
| parent | ce64d7af6cd5985eb135a86e43eec08d7b4d5aed (diff) | |
| download | dotfiles-e406848e48b4bef66572d94feead19a4f382a561.tar dotfiles-e406848e48b4bef66572d94feead19a4f382a561.tar.gz dotfiles-e406848e48b4bef66572d94feead19a4f382a561.zip | |
feat(bash): Improve coloring escape sequences for low-color terminals
Diffstat (limited to '.bashrc')
| -rw-r--r-- | .bashrc | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -33,10 +33,15 @@ export PROMPT_COMMAND="shell_var_fix;" # $1 foreground color [REQUIRED] # $2 background color [REQUIRED] colors_prt() { - printf "\001\e[38;5;${1}m\e[48;5;${2}m\002" + if hc_mode + then + printf "\001\e[38;5;${1}m\e[48;5;${2}m\002" + else + printf "\001\e[${1}m\e[${2}m\002" + fi } colors_res() { - printf "\001\e[39m\e[49m\002" + printf "\001\e[0m\002" } # $1 cap colour [OPTIONAL] @@ -194,6 +199,7 @@ export PROMPT_COMMAND="shell_var_fix;" } ps_precursor() { + colors_res [ ! -w . ] && colors_prt "$PS_WARN" "$PS_BG" if [ -n "$___changes" ] then |
