mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Store sessions in an RB tree by name rather than a list, this is tidier
and allows them to easily be shown sorted in various lists (list-sessions/choose-sessions). Keep a session index which is used in a couple of places internally but make it an ever-increasing number rather than filling in gaps with new sessions.
This commit is contained in:
@ -53,8 +53,10 @@ cmd_rename_session_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
if ((s = cmd_find_session(ctx, data->target)) == NULL)
|
||||
return (-1);
|
||||
|
||||
RB_REMOVE(sessions, &sessions, s);
|
||||
xfree(s->name);
|
||||
s->name = xstrdup(data->arg);
|
||||
RB_INSERT(sessions, &sessions, s);
|
||||
|
||||
server_status_session(s);
|
||||
|
||||
|
Reference in New Issue
Block a user