mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Make tmux window named after cwd
This commit is contained in:
+15
-5
@@ -12,12 +12,22 @@ alias eff='$EDITOR "$(ff)"'
|
||||
if command -v zoxide &> /dev/null; then
|
||||
alias cd="zd"
|
||||
zd() {
|
||||
if [ $# -eq 0 ]; then
|
||||
builtin cd ~ && return
|
||||
elif [ -d "$1" ]; then
|
||||
builtin cd "$1"
|
||||
if (( $# == 0 )); then
|
||||
builtin cd ~ || return
|
||||
elif [[ -d $1 ]]; then
|
||||
builtin cd "$1" || return
|
||||
else
|
||||
z "$@" && printf "\U000F17A9 " && pwd || echo "Error: Directory not found"
|
||||
if ! z "$@"; then
|
||||
echo "Error: Directory not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
printf "\U000F17A9 "
|
||||
pwd
|
||||
fi
|
||||
|
||||
if [[ -n $TMUX ]]; then
|
||||
tmux rename-window "$(basename "$PWD")"
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user