summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorMike Vink <ivi@vinkies.net>2025-02-11 08:03:21 +0000
committerMike Vink <ivi@vinkies.net>2025-02-11 08:03:21 +0000
commit37a77bcd70781a4fe75c3477f08fbb8a5b2ba858 (patch)
treeb568adfa9823c6d4742e8bfa63dbd356b8a7602d /.config
parent22a6d87cdf52b5cf8d5a2ae559b152dfb51f58a4 (diff)
update prompt
Diffstat (limited to '.config')
-rw-r--r--.config/ksh/ksh.kshrc6
1 files changed, 5 insertions, 1 deletions
diff --git a/.config/ksh/ksh.kshrc b/.config/ksh/ksh.kshrc
index 578ffa8..000ed44 100644
--- a/.config/ksh/ksh.kshrc
+++ b/.config/ksh/ksh.kshrc
@@ -11,8 +11,12 @@ bind -m ^O=' lfcd^J'
# Emacs mode clear chops off multline prompts.
export PS1="$(hostname):/\$(
+root=\$(pwd | cut -d'/' -f2- --output-delimiter '
+' | head -n-3 | cut -c1-3 | paste -sd '/')
+[ -z \$root ] || echo "\${root}/"
+)\$(
pwd | cut -d'/' -f2- --output-delimiter '
-' | cut -c1-3 | paste -sd '/'
+' | tail -n3 | paste -sd '/'
)\$(prompt-git)\n jobs(\j) # "
bind -m ^L="^A^K clear^J"