Move append existing session logic to launcher
This commit is contained in:
parent
e95e125151
commit
d272de21c3
3 changed files with 11 additions and 11 deletions
|
|
@ -11,11 +11,6 @@ if [ -z "$SESSION_NAME" ] || [ -z "$CODE_PATH" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if tmux has-session -t $SESSION_NAME 2>/dev/null; then
|
||||
tmux attach-session -t $SESSION_NAME
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tmux new-session -d -s $SESSION_NAME -c "$CODE_PATH"
|
||||
tmux rename-window -t $SESSION_NAME:1 "nvim"
|
||||
tmux send-keys -t $SESSION_NAME:1 "nvim" C-m
|
||||
|
|
|
|||
|
|
@ -14,11 +14,6 @@ if [ -z "$SESSION_NAME" ] || [ -z "$CODE_PATH" ] || [ -z "$PAPER_PATH" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if tmux has-session -t $SESSION_NAME 2>/dev/null; then
|
||||
tmux attach-session -t $SESSION_NAME
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Create windows for code
|
||||
tmux new-session -d -s $SESSION_NAME -c "$CODE_PATH"
|
||||
tmux rename-window -t $SESSION_NAME:1 "code"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue