我有这个设置:
# Number windows and panes starting at 1 so that we can jump to
# them easier.
set -g base-index 1
set -g pane-base-index 1
Run Code Online (Sandbox Code Playgroud)
但我也希望在切换 tmux 会话时使用相同的方法。当我打开 tmux 会话列表时,它仍然从 0 开始。是否可以不从 0 开始会话计数,而是从 1 开始?
您似乎指的是生成的会话组索引,而不是用于告诉tmux
您要附加到哪个会话。
它在模板list-sessions
中用于:
"#{?session_grouped, (group ,}" \
Run Code Online (Sandbox Code Playgroud)
并生成于session.c
(并且始终从零开始):
/* Find session group index. */
u_int
session_group_index(struct session_group *sg)
{
struct session_group *sg2;
u_int i;
i = 0;
TAILQ_FOREACH(sg2, &session_groups, entry) {
if (sg == sg2)
return (i);
i++;
}
fatalx("session group not found");
}
Run Code Online (Sandbox Code Playgroud)
但该值仅用于格式化输出。