diff --git a/tmux-oneshot.sh b/tmux-oneshot.sh index 05b3a1c..dc6ad3f 100644 --- a/tmux-oneshot.sh +++ b/tmux-oneshot.sh @@ -71,7 +71,7 @@ fi # Use command line arguments if provided, otherwise use config if [ $# -gt 0 ]; then - COMMANDS=("$*") + COMMANDS=("$@") echo "Using command line arguments: $*" else if [ ${#COMMANDS[@]} -eq 0 ]; then @@ -81,11 +81,6 @@ else echo "Using config commands: ${COMMANDS[*]}" fi -# Use session name from config, or first word of first command if not set -if [ -z "$SESSION" ]; then - SESSION=$(echo "${COMMANDS[0]}" | awk '{print $1}') -fi - # Create session if missing if ! tmux has-session -t $SESSION 2>/dev/null; then echo "Creating tmux session: $SESSION"