#!/bin/bash

# Start tmux session with vertical split (side-by-side panes)
tmux new-session -d -s mcsetup  # Creates base session
tmux split-window -h            # Splits right pane horizontally (side-by-side)
tmux select-pane -t 0           # Focus left pane
tmux send-keys 'playit' Enter   # Run Playit in left pane
tmux select-pane -t 1           # Focus right pane

# Wait for Playit to connect (shows tunnel domain in left pane)
sleep 10

tmux send-keys 'cd ~/Documents/PruebaMC_Server/ && java -Xmx4G -Xms4G -jar Server_prueba.jar nogui' Enter

# Attach to the tmux session so you see both panes live
tmux attach-session -t mcsetup

