fix(tmuxinator): change mx to tat and get_mx_sessions to tls
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
todo.md
|
todo.md
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
**/lazy-lock.json
|
**/lazy-lock.json
|
||||||
|
|
||||||
|
**/.claude/settings.local.json
|
||||||
|
|||||||
@@ -127,12 +127,8 @@ function ccd() {
|
|||||||
printf "%q" "$(pwd)" | pbcopy
|
printf "%q" "$(pwd)" | pbcopy
|
||||||
}
|
}
|
||||||
|
|
||||||
alias tat="tmux attach -t"
|
|
||||||
|
|
||||||
alias t="tmux"
|
alias t="tmux"
|
||||||
|
|
||||||
alias tls="tmux ls"
|
|
||||||
|
|
||||||
function ip() {
|
function ip() {
|
||||||
dig +short myip.opendns.com @resolver1.opendns.com
|
dig +short myip.opendns.com @resolver1.opendns.com
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
function mx() {
|
function tat() {
|
||||||
PROJECT_DIR=${1:-.}
|
PROJECT_DIR=${1:-.}
|
||||||
SAFE_INPUT=$(printf '%s\n' "$PROJECT_DIR" | sed 's/[][\.^$*+?{}|()]/\\&/g')
|
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)
|
IS_VALID_PROJECT=$(echo $ALL_PROJECTS | grep -io "[[:<:]]$SAFE_INPUT\w*" | head -1)
|
||||||
if [[ $IS_VALID_PROJECT != "" ]]; then
|
if [[ $IS_VALID_PROJECT != "" ]]; then
|
||||||
tmuxinator start "$IS_VALID_PROJECT"
|
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 '^$'
|
tmuxinator list | grep -v tmuxinator | tr ' ' '\n' | grep -v '^$'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ function _mx_autocomplete() {
|
|||||||
local expl
|
local expl
|
||||||
|
|
||||||
# Get tmuxinator projects
|
# Get tmuxinator projects
|
||||||
projects=(${(f)"$(get_mux_sessions)"})
|
projects=(${(f)"$(tls)"})
|
||||||
|
|
||||||
# Get files and directories with proper completion
|
# Get files and directories with proper completion
|
||||||
_alternative \
|
_alternative \
|
||||||
@@ -49,8 +49,8 @@ function _mx_autocomplete() {
|
|||||||
|
|
||||||
# Register the completion function for zsh
|
# Register the completion function for zsh
|
||||||
if [[ -n ${ZSH_VERSION-} ]]; then
|
if [[ -n ${ZSH_VERSION-} ]]; then
|
||||||
compdef _mx_autocomplete mx
|
compdef _mx_autocomplete tat
|
||||||
else
|
else
|
||||||
# Fallback for bash
|
# Fallback for bash
|
||||||
complete -f -F _mx_autocomplete -o default mx
|
complete -f -F _mx_autocomplete -o default tat
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user