mirror of
https://github.com/tmux/tmux.git
synced 2026-10-10 04:04:27 +00:00
Merge branch 'master' into command_parser
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: server-client.c,v 1.517 2026/10/02 12:48:52 nicm Exp $ */
|
/* $OpenBSD: server-client.c,v 1.518 2026/10/06 10:55:55 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -791,9 +791,14 @@ server_client_check_mouse(struct client *c, struct key_event *event)
|
|||||||
x = m->x, y = m->y, b = m->b;
|
x = m->x, y = m->y, b = m->b;
|
||||||
if (x == m->lx && y == m->ly)
|
if (x == m->lx && y == m->ly)
|
||||||
return (KEYC_UNKNOWN);
|
return (KEYC_UNKNOWN);
|
||||||
|
if (c->tty.mouse_drag_status) {
|
||||||
|
x = c->tty.mouse_drag_x;
|
||||||
|
y = c->tty.mouse_drag_y;
|
||||||
|
}
|
||||||
log_debug("drag update at %u,%u", x, y);
|
log_debug("drag update at %u,%u", x, y);
|
||||||
} else {
|
} else {
|
||||||
x = m->lx, y = m->ly, b = m->lb;
|
x = m->lx, y = m->ly, b = m->lb;
|
||||||
|
c->tty.mouse_drag_status = 0;
|
||||||
log_debug("drag start at %u,%u", x, y);
|
log_debug("drag start at %u,%u", x, y);
|
||||||
}
|
}
|
||||||
} else if (MOUSE_WHEEL(m->b)) {
|
} else if (MOUSE_WHEEL(m->b)) {
|
||||||
@@ -851,6 +856,8 @@ have_event:
|
|||||||
if (m->statusat != -1 &&
|
if (m->statusat != -1 &&
|
||||||
y >= (u_int)m->statusat &&
|
y >= (u_int)m->statusat &&
|
||||||
y < m->statusat + m->statuslines) {
|
y < m->statusat + m->statuslines) {
|
||||||
|
if (type == KEYC_TYPE_MOUSEDRAG && c->tty.mouse_drag_flag == 0)
|
||||||
|
c->tty.mouse_drag_status = 1;
|
||||||
sr = status_get_range(c, x, y - m->statusat);
|
sr = status_get_range(c, x, y - m->statusat);
|
||||||
if (sr == NULL) {
|
if (sr == NULL) {
|
||||||
loc = KEYC_MOUSE_LOCATION_STATUS_DEFAULT;
|
loc = KEYC_MOUSE_LOCATION_STATUS_DEFAULT;
|
||||||
@@ -1082,17 +1089,24 @@ have_event:
|
|||||||
* where the user grabbed.
|
* where the user grabbed.
|
||||||
*/
|
*/
|
||||||
if (c->tty.mouse_drag_flag == 0) {
|
if (c->tty.mouse_drag_flag == 0) {
|
||||||
c->tty.mouse_drag_x = px;
|
if (c->tty.mouse_drag_status) {
|
||||||
c->tty.mouse_drag_y = py;
|
c->tty.mouse_drag_x = x;
|
||||||
|
c->tty.mouse_drag_y = y;
|
||||||
|
} else {
|
||||||
|
c->tty.mouse_drag_x = px;
|
||||||
|
c->tty.mouse_drag_y = py;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
c->tty.mouse_drag_flag = MOUSE_BUTTONS(b) + 1;
|
c->tty.mouse_drag_flag = MOUSE_BUTTONS(b) + 1;
|
||||||
|
|
||||||
/* Only change pane if not already dragging a pane border. */
|
/* Change the pane if the drag did not start on status line. */
|
||||||
if (lwp == NULL) {
|
if (!c->tty.mouse_drag_status && lwp == NULL) {
|
||||||
lwp = wp = window_get_active_at(w, px, py);
|
lwp = wp = window_get_active_at(w, px, py);
|
||||||
if (wp != NULL)
|
if (wp != NULL)
|
||||||
c->tty.mouse_last_pane = wp->id;
|
c->tty.mouse_last_pane = wp->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Change scrollbar position if needed. */
|
||||||
if (c->tty.mouse_scrolling_flag == 0 &&
|
if (c->tty.mouse_scrolling_flag == 0 &&
|
||||||
loc == KEYC_MOUSE_LOCATION_SCROLLBAR_SLIDER) {
|
loc == KEYC_MOUSE_LOCATION_SCROLLBAR_SLIDER) {
|
||||||
c->tty.mouse_scrolling_flag = 1;
|
c->tty.mouse_scrolling_flag = 1;
|
||||||
|
|||||||
9
tmux.1
9
tmux.1
@@ -1,4 +1,4 @@
|
|||||||
.\" $OpenBSD: tmux.1,v 1.1175 2026/10/06 08:01:54 nicm Exp $
|
.\" $OpenBSD: tmux.1,v 1.1176 2026/10/06 11:30:31 nicm Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
.\"
|
.\"
|
||||||
@@ -5314,6 +5314,13 @@ If
|
|||||||
.Ic keep\-group ,
|
.Ic keep\-group ,
|
||||||
destroy the session unless it is in a group and is the only session in that
|
destroy the session unless it is in a group and is the only session in that
|
||||||
group.
|
group.
|
||||||
|
A session without attached clients is destroyed or kept as follows:
|
||||||
|
.Bl -column "in group, NOT last" "keep" "destroy" "keep\-last" "keep\-group"
|
||||||
|
.It Sy "Session" Ta Sy "off" Ta Sy "on" Ta Sy "keep\-last" Ta Sy "keep\-group"
|
||||||
|
.It Li "NOT in group" Ta keep Ta destroy Ta keep Ta destroy
|
||||||
|
.It Li "in group, NOT last" Ta keep Ta destroy Ta destroy Ta destroy
|
||||||
|
.It Li "last in group" Ta keep Ta destroy Ta keep Ta keep
|
||||||
|
.El
|
||||||
.It Xo Ic detach\-on\-destroy
|
.It Xo Ic detach\-on\-destroy
|
||||||
.Op Ic off | on | no\-detached | previous | next
|
.Op Ic off | on | no\-detached | previous | next
|
||||||
.Xc
|
.Xc
|
||||||
|
|||||||
3
tmux.h
3
tmux.h
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: tmux.h,v 1.1451 2026/10/02 12:48:52 nicm Exp $ */
|
/* $OpenBSD: tmux.h,v 1.1452 2026/10/06 10:55:55 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -1847,6 +1847,7 @@ struct tty {
|
|||||||
u_int mouse_last_y;
|
u_int mouse_last_y;
|
||||||
u_int mouse_last_b;
|
u_int mouse_last_b;
|
||||||
int mouse_drag_flag;
|
int mouse_drag_flag;
|
||||||
|
int mouse_drag_status;
|
||||||
u_int mouse_drag_x;
|
u_int mouse_drag_x;
|
||||||
u_int mouse_drag_y;
|
u_int mouse_drag_y;
|
||||||
int mouse_scrolling_flag;
|
int mouse_scrolling_flag;
|
||||||
|
|||||||
Reference in New Issue
Block a user