Add remote server support to research template
- Add server and remoteDir fields to research projects configuration - Update project launcher to handle remote server parameters - Enhance research template with remote server window (window 7) - Add dual-pane remote SSH connections with auto-reconnect aliases - Document remote server features in README with configuration examples Features: - Type 'r' in any remote pane to reconnect after network drops - Automatic SSH connection and directory navigation - Parallel remote work with dual panes - Backwards compatible - optional server configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c3872475b5
commit
5b2d62ffa6
5 changed files with 54 additions and 6 deletions
|
|
@ -1,14 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Research workflow template - code + separate paper directory
|
||||
# Usage: research.sh SESSION_NAME CODE_PATH PAPER_PATH
|
||||
# Research workflow template - code + separate paper directory + optional remote server
|
||||
# Usage: research.sh SESSION_NAME CODE_PATH PAPER_PATH [SERVER] [REMOTE_DIR]
|
||||
|
||||
SESSION_NAME="$1"
|
||||
CODE_PATH="$2"
|
||||
PAPER_PATH="$3"
|
||||
SERVER="$4"
|
||||
REMOTE_DIR="$5"
|
||||
|
||||
if [ -z "$SESSION_NAME" ] || [ -z "$CODE_PATH" ] || [ -z "$PAPER_PATH" ]; then
|
||||
echo "Usage: $0 SESSION_NAME CODE_PATH PAPER_PATH"
|
||||
echo "Usage: $0 SESSION_NAME CODE_PATH PAPER_PATH [SERVER] [REMOTE_DIR]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -41,6 +43,17 @@ tmux select-pane -t $SESSION_NAME:5.1
|
|||
tmux new-window -t $SESSION_NAME:6 -n "paper-git" -c "$PAPER_PATH"
|
||||
tmux send-keys -t $SESSION_NAME:6 "gitui" C-m
|
||||
|
||||
# Create remote server window if server details are provided
|
||||
if [ -n "$SERVER" ] && [ -n "$REMOTE_DIR" ]; then
|
||||
tmux new-window -t $SESSION_NAME:7 -n "remote" -c "$CODE_PATH"
|
||||
tmux send-keys -t $SESSION_NAME:7 "alias r='ssh $SERVER -t \"cd $REMOTE_DIR && exec \\\$SHELL\"'" C-m
|
||||
tmux send-keys -t $SESSION_NAME:7 "ssh $SERVER -t 'cd $REMOTE_DIR && exec \$SHELL'" C-m
|
||||
tmux split-window -t $SESSION_NAME:7 -v -c "$CODE_PATH"
|
||||
tmux send-keys -t $SESSION_NAME:7.2 "alias r='ssh $SERVER -t \"cd $REMOTE_DIR && exec \\\$SHELL\"'" C-m
|
||||
tmux send-keys -t $SESSION_NAME:7.2 "ssh $SERVER -t 'cd $REMOTE_DIR && exec \$SHELL'" C-m
|
||||
tmux select-pane -t $SESSION_NAME:7.1
|
||||
fi
|
||||
|
||||
tmux select-window -t $SESSION_NAME:1
|
||||
|
||||
tmux attach-session -t $SESSION_NAME
|
||||
Loading…
Add table
Add a link
Reference in a new issue