Skip to content

Commit 496de86

Browse files
committed
fix: new session not naming correctly
1 parent f0c8041 commit 496de86

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/new_session.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ session_name_not_provided() {
1111
[ -z "$SESSION_NAME" ]
1212
}
1313

14+
create_named_session() {
15+
if [ "$(get_tmux_option "@sessionist-maintain-path")" == "on" ]; then
16+
TMUX="" tmux -S "$(tmux_socket)" new-session -c "$1" -s "$SESSION_NAME" -d -P -F "#{session_id}"
17+
else
18+
TMUX="" tmux -S "$(tmux_socket)" new-session -s "$SESSION_NAME" -d -P -F "#{session_id}"
19+
fi
20+
}
21+
1422
create_new_tmux_session() {
1523
if session_name_not_provided; then
1624
exit 0
@@ -21,7 +29,7 @@ create_new_tmux_session() {
2129
# New session name may differ from the input. Eg input name may be
2230
# 'foo.bar', but new name will be 'foo_bar'.
2331
local pane_current_path=$(tmux display-message -p "#{pane_current_path}")
24-
local session_id=$(create_session "$pane_current_path")
32+
local session_id=$(create_named_session "$SESSION_NAME")
2533
switch_to_session "$session_id"
2634
fi
2735
}

0 commit comments

Comments
 (0)