mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Enable load-session command from outside of Tmux
This means that "init" session layouts can now be used to start and/or re-attach to your main session. Personally I have a "main" session layout with a couple of default windows. I can now either start that session, or re-attach to it from outside of Tmux by just running `tmuxifier s main`, instead of manually creating a session named "main" and then loading my windows into it.
This commit is contained in:
@@ -187,9 +187,6 @@ initialize_session() {
|
|||||||
local first_window_index=$(__get_first_window_index)
|
local first_window_index=$(__get_first_window_index)
|
||||||
tmux move-window -s "$session:$first_window_index" -t "$session:999"
|
tmux move-window -s "$session:$first_window_index" -t "$session:999"
|
||||||
|
|
||||||
# Ensure correct pane splitting.
|
|
||||||
__go_to_session
|
|
||||||
|
|
||||||
# Session created, return ok exit status.
|
# Session created, return ok exit status.
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -18,9 +18,5 @@ fi
|
|||||||
# Load runtime functions.
|
# Load runtime functions.
|
||||||
source "$TMUXIFIER/runtime.sh"
|
source "$TMUXIFIER/runtime.sh"
|
||||||
|
|
||||||
if [ ! -z $TMUX ]; then
|
# Load session file.
|
||||||
load_session "$1"
|
load_session "$1"
|
||||||
else
|
|
||||||
echo "tmuxifier: 'load-session' command can only be used from within Tmux."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user