File: ondir_prompt_hook.fish

package info (click to toggle)
ondir 0.2.3%2Bgit0.55279f03-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 188 kB
  • ctags: 53
  • sloc: ansic: 450; makefile: 70; sh: 13; csh: 2
file content (6 lines) | stat: -rw-r--r-- 259 bytes parent folder | download
1
2
3
4
5
6
# copy this file to ~/.config/fish/functions
function ondir_prompt_hook --on-event fish_prompt
    if test ! -e "$OLDONDIRWD"; set -g OLDONDIRWD /; end;
    if [ "$OLDONDIRWD" != "$PWD" ]; eval (ondir $OLDONDIRWD $PWD); end;
    set -g OLDONDIRWD "$PWD";
end