Skip to content

Instantly share code, notes, and snippets.

@mario21ic
Last active April 6, 2016 00:20
Show Gist options
  • Save mario21ic/72b3cd62ae00e4a527ef to your computer and use it in GitHub Desktop.
Save mario21ic/72b3cd62ae00e4a527ef to your computer and use it in GitHub Desktop.
tmux_2panel
#!/bin/bash
if [ -z $1 ];
then
session=$(basename `pwd`)
else
session=$1
fi
tmux has-session -t $session
if [ $? != 0 ]
then
tmux has-session
tmux new-session -s $session -n editor -d
tmux split-window -v -p 30 -t $session
tmux select-pane -t $session:0.0
fi
tmux -2 attach -t $session
@mario21ic
Copy link
Author

Usage:

  • ./t2 => launch without parameter and tmux create a session with name "t2"
  • ./t2 dev => tmux create ssession "dev"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment