mirror of
https://github.com/tmux/tmux.git
synced 2025-01-13 03:48:51 +00:00
Dead sessions are never on the active sessions list, so the SESSION_DEAD
flag is effectively unused. Remove it.
This commit is contained in:
parent
9358cfaf4a
commit
8705c6b435
@ -167,7 +167,6 @@ session_destroy(struct session *s)
|
|||||||
}
|
}
|
||||||
if (i == ARRAY_LENGTH(&dead_sessions))
|
if (i == ARRAY_LENGTH(&dead_sessions))
|
||||||
ARRAY_ADD(&dead_sessions, s);
|
ARRAY_ADD(&dead_sessions, s);
|
||||||
s->flags |= SESSION_DEAD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find session index. */
|
/* Find session index. */
|
||||||
@ -188,7 +187,7 @@ session_next_session(struct session *s)
|
|||||||
struct session *s2;
|
struct session *s2;
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
if (ARRAY_LENGTH(&sessions) == 0 || session_index(s, &i) != 0)
|
if (ARRAY_LENGTH(&sessions) == 0 || !session_alive(s))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -197,7 +196,7 @@ session_next_session(struct session *s)
|
|||||||
else
|
else
|
||||||
i++;
|
i++;
|
||||||
s2 = ARRAY_ITEM(&sessions, i);
|
s2 = ARRAY_ITEM(&sessions, i);
|
||||||
} while (s2 == NULL || s2->flags & SESSION_DEAD);
|
} while (s2 == NULL);
|
||||||
|
|
||||||
return (s2);
|
return (s2);
|
||||||
}
|
}
|
||||||
@ -209,7 +208,7 @@ session_previous_session(struct session *s)
|
|||||||
struct session *s2;
|
struct session *s2;
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
if (ARRAY_LENGTH(&sessions) == 0 || session_index(s, &i) != 0)
|
if (ARRAY_LENGTH(&sessions) == 0 || !session_alive(s))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -218,7 +217,7 @@ session_previous_session(struct session *s)
|
|||||||
else
|
else
|
||||||
i--;
|
i--;
|
||||||
s2 = ARRAY_ITEM(&sessions, i);
|
s2 = ARRAY_ITEM(&sessions, i);
|
||||||
} while (s2 == NULL || s2->flags & SESSION_DEAD);
|
} while (s2 == NULL);
|
||||||
|
|
||||||
return (s2);
|
return (s2);
|
||||||
}
|
}
|
||||||
|
1
tmux.h
1
tmux.h
@ -948,7 +948,6 @@ struct session {
|
|||||||
struct paste_stack buffers;
|
struct paste_stack buffers;
|
||||||
|
|
||||||
#define SESSION_UNATTACHED 0x1 /* not attached to any clients */
|
#define SESSION_UNATTACHED 0x1 /* not attached to any clients */
|
||||||
#define SESSION_DEAD 0x2
|
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
struct termios *tio;
|
struct termios *tio;
|
||||||
|
Loading…
Reference in New Issue
Block a user