tmux-ai-prompts
This commit is contained in:
commit
d2b56055fe
36
bash_functions/tmux-ai-prompts.sh
Normal file
36
bash_functions/tmux-ai-prompts.sh
Normal file
@ -0,0 +1,36 @@
|
||||
function tmux-ai-prompts() {
|
||||
local session_name="$1"
|
||||
|
||||
# Check if a session name is provided
|
||||
if [[ -z "$session_name" ]]; then
|
||||
echo "Error: Session name is required. Usage: start_tmux_session
|
||||
ession_name>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check if a tmux session with the given name already exists
|
||||
if tmux has-session -t "$session_name"; then
|
||||
echo "Error: A tmux session with the name '$session_name' already
|
||||
ists."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Start the tmux session and create initial pane
|
||||
tmux new-session -s "$session_name" -d "gemini"
|
||||
tmux set-window-option -g automatic-rename off >/dev/null
|
||||
tmux select-pane -T "gemini"
|
||||
|
||||
# Split window horizontally and run commands
|
||||
tmux split-window -v -t "$session_name:0" \; send-keys "gpt" C-m
|
||||
tmux select-pane -T "gpt"
|
||||
tmux split-window -v -t "$session_name:0" \; send-keys "gpt --model claude-3.5-sonnet" C-m
|
||||
tmux select-pane -T "claude"
|
||||
|
||||
tmux select-layout tiled >/dev/null
|
||||
tmux set-window-option synchronize-panes on >/dev/null
|
||||
|
||||
# Attach to the session (optional - comment out if you don't want to attach automatically)
|
||||
tmux select-pane -t 0
|
||||
tmux attach-session -t "$session_name"
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user