mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 01:46:40 +00:00
Fix issue #28, default-path error with Tmux 1.9
When using Tmux 1.9 and later the "-c" argument is given to the "new-session" command to set the session's root/default path. When using Tmux 1.8.x and earlier, the old "default-path" session option method is used instead.
This commit is contained in:
@@ -233,16 +233,25 @@ initialize_session() {
|
||||
|
||||
# Check if the named session already exists.
|
||||
if ! tmuxifier-tmux has-session -t "$session:" 2>/dev/null; then
|
||||
# Create the new session.
|
||||
env TMUX="" tmuxifier-tmux new-session -d -s "$session"
|
||||
if [ "$(tmuxifier-tmux-version "1.9")" == "<" ]; then
|
||||
# Tmux 1.8 and earlier.
|
||||
|
||||
# Set default-path for session
|
||||
if [ -n "$session_root" ] && [ -d "$session_root" ]; then
|
||||
cd "$session_root"
|
||||
# Create the new session.
|
||||
env TMUX="" tmuxifier-tmux new-session -d -s "$session"
|
||||
|
||||
$set_default_path && tmuxifier-tmux \
|
||||
set-option -t "$session:" \
|
||||
default-path "$session_root" 1>/dev/null
|
||||
# Set default-path for session
|
||||
if [ -n "$session_root" ] && [ -d "$session_root" ]; then
|
||||
cd "$session_root"
|
||||
|
||||
$set_default_path && tmuxifier-tmux \
|
||||
set-option -t "$session:" \
|
||||
default-path "$session_root" 1>/dev/null
|
||||
fi
|
||||
else
|
||||
# Tmux 1.9 and later.
|
||||
if $set_default_path; then local session_args=(-c "$session_root"); fi
|
||||
env TMUX="" tmuxifier-tmux new-session \
|
||||
-d -s "$session" "${session_args[@]}"
|
||||
fi
|
||||
|
||||
# In order to ensure only specified windows are created, we move the
|
||||
|
||||
Reference in New Issue
Block a user