mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Instead of numbering session groups, give them a name which may be given
to -t instead of a target session. Also allow them to contain only one session.
This commit is contained in:
12
server-fn.c
12
server-fn.c
@ -78,7 +78,7 @@ server_redraw_session_group(struct session *s)
|
||||
{
|
||||
struct session_group *sg;
|
||||
|
||||
if ((sg = session_group_find(s)) == NULL)
|
||||
if ((sg = session_group_contains(s)) == NULL)
|
||||
server_redraw_session(s);
|
||||
else {
|
||||
TAILQ_FOREACH(s, &sg->sessions, gentry)
|
||||
@ -102,7 +102,7 @@ server_status_session_group(struct session *s)
|
||||
{
|
||||
struct session_group *sg;
|
||||
|
||||
if ((sg = session_group_find(s)) == NULL)
|
||||
if ((sg = session_group_contains(s)) == NULL)
|
||||
server_status_session(s);
|
||||
else {
|
||||
TAILQ_FOREACH(s, &sg->sessions, gentry)
|
||||
@ -220,7 +220,7 @@ server_kill_window(struct window *w)
|
||||
}
|
||||
|
||||
if (options_get_number(s->options, "renumber-windows")) {
|
||||
if ((sg = session_group_find(s)) != NULL) {
|
||||
if ((sg = session_group_contains(s)) != NULL) {
|
||||
TAILQ_FOREACH(target_s, &sg->sessions, gentry)
|
||||
session_renumber_windows(target_s);
|
||||
} else
|
||||
@ -238,8 +238,8 @@ server_link_window(struct session *src, struct winlink *srcwl,
|
||||
struct winlink *dstwl;
|
||||
struct session_group *srcsg, *dstsg;
|
||||
|
||||
srcsg = session_group_find(src);
|
||||
dstsg = session_group_find(dst);
|
||||
srcsg = session_group_contains(src);
|
||||
dstsg = session_group_contains(dst);
|
||||
if (src != dst && srcsg != NULL && dstsg != NULL && srcsg == dstsg) {
|
||||
xasprintf(cause, "sessions are grouped");
|
||||
return (-1);
|
||||
@ -348,7 +348,7 @@ server_destroy_session_group(struct session *s)
|
||||
struct session_group *sg;
|
||||
struct session *s1;
|
||||
|
||||
if ((sg = session_group_find(s)) == NULL)
|
||||
if ((sg = session_group_contains(s)) == NULL)
|
||||
server_destroy_session(s);
|
||||
else {
|
||||
TAILQ_FOREACH_SAFE(s, &sg->sessions, gentry, s1) {
|
||||
|
Reference in New Issue
Block a user