From fdf5efedb1b385cda32c51c9cc5789f6e0cdf2b3 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 6 Oct 2025 09:10:07 +0200 Subject: [PATCH] fix(tmuxinator): change mx to tat and get_mx_sessions to tls --- git/ignore | 2 ++ omz-custom/custom_commands.sh | 4 ---- omz-custom/tmux-sessions.sh | 12 ++++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/git/ignore b/git/ignore index df0ba52..5fd3da1 100644 --- a/git/ignore +++ b/git/ignore @@ -1,3 +1,5 @@ todo.md **/.DS_Store **/lazy-lock.json + +**/.claude/settings.local.json diff --git a/omz-custom/custom_commands.sh b/omz-custom/custom_commands.sh index bc47f89..73695be 100755 --- a/omz-custom/custom_commands.sh +++ b/omz-custom/custom_commands.sh @@ -127,12 +127,8 @@ function ccd() { printf "%q" "$(pwd)" | pbcopy } -alias tat="tmux attach -t" - alias t="tmux" -alias tls="tmux ls" - function ip() { dig +short myip.opendns.com @resolver1.opendns.com } diff --git a/omz-custom/tmux-sessions.sh b/omz-custom/tmux-sessions.sh index 86aa983..7d1d756 100644 --- a/omz-custom/tmux-sessions.sh +++ b/omz-custom/tmux-sessions.sh @@ -1,7 +1,7 @@ -function mx() { +function tat() { PROJECT_DIR=${1:-.} SAFE_INPUT=$(printf '%s\n' "$PROJECT_DIR" | sed 's/[][\.^$*+?{}|()]/\\&/g') - ALL_PROJECTS=$(get_mux_sessions) + ALL_PROJECTS=$(tls) IS_VALID_PROJECT=$(echo $ALL_PROJECTS | grep -io "[[:<:]]$SAFE_INPUT\w*" | head -1) if [[ $IS_VALID_PROJECT != "" ]]; then tmuxinator start "$IS_VALID_PROJECT" @@ -30,7 +30,7 @@ function mx() { } -function get_mux_sessions() { +function tls() { tmuxinator list | grep -v tmuxinator | tr ' ' '\n' | grep -v '^$' } @@ -39,7 +39,7 @@ function _mx_autocomplete() { local expl # Get tmuxinator projects - projects=(${(f)"$(get_mux_sessions)"}) + projects=(${(f)"$(tls)"}) # Get files and directories with proper completion _alternative \ @@ -49,8 +49,8 @@ function _mx_autocomplete() { # Register the completion function for zsh if [[ -n ${ZSH_VERSION-} ]]; then - compdef _mx_autocomplete mx + compdef _mx_autocomplete tat else # Fallback for bash - complete -f -F _mx_autocomplete -o default mx + complete -f -F _mx_autocomplete -o default tat fi