zsh,vm-list,karabiner,ghostty
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
# Optional:
|
||||
# --no-tmux -> skips attaching to tmux session
|
||||
|
||||
skip_tmux=0
|
||||
# TMP: Tmux will be disabled (switch to 0 to enable it again)
|
||||
skip_tmux=1
|
||||
|
||||
# Check for --no-tmux flag
|
||||
if [[ "$1" == "--no-tmux" ]]; then
|
||||
@@ -22,6 +23,8 @@ if [[ "$1" == "--no-tmux" ]]; then
|
||||
fi
|
||||
|
||||
full="$1"
|
||||
shift # remove host from args
|
||||
|
||||
user="$USER"
|
||||
host="$full"
|
||||
|
||||
@@ -54,7 +57,7 @@ case "$host" in
|
||||
esac
|
||||
|
||||
# Build SSH command safely using an array
|
||||
ssh_cmd=(ssh -t)
|
||||
ssh_cmd=(ssh -tt)
|
||||
|
||||
# Include identity file if needed
|
||||
[[ -n "$ssh_identity" ]] && ssh_cmd+=(-i "$ssh_identity" -o IdentitiesOnly=yes)
|
||||
@@ -63,7 +66,12 @@ ssh_cmd=(ssh -t)
|
||||
ssh_cmd+=("$user@$ssh_host")
|
||||
|
||||
# Add tmux session unless skipped
|
||||
[[ $skip_tmux -eq 0 ]] && ssh_cmd+=("tmux" "new" "-A" "-s" "$tmux_session")
|
||||
if [[ $skip_tmux -eq 0 ]]; then
|
||||
ssh_cmd+=("tmux" "new" "-A" "-s" "$tmux_session")
|
||||
else
|
||||
# Pass through any extra args user supplied
|
||||
ssh_cmd+=("$@")
|
||||
fi
|
||||
|
||||
# Replace current shell with SSH command
|
||||
# echo "Executing: ${ssh_cmd[*]}" >&2
|
||||
|
||||
Reference in New Issue
Block a user