Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2024-04-10 10:01:13 +01:00
commit 43530d4397
6 changed files with 25 additions and 4 deletions

View File

@ -2372,7 +2372,9 @@ input_exit_osc(struct input_ctx *ictx)
switch (option) {
case 0:
case 2:
if (screen_set_title(sctx->s, p) && wp != NULL) {
if (wp != NULL &&
options_get_number(wp->options, "allow-set-title") &&
screen_set_title(sctx->s, p)) {
notify_pane("pane-title-changed", wp);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);

View File

@ -875,6 +875,14 @@ const struct options_table_entry options_table[] = {
"to rename windows."
},
{ .name = "allow-set-title",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
.default_num = 1,
.text = "Whether applications are allowed to use the escape sequence "
"to set the pane title."
},
{ .name = "alternate-screen",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,

View File

@ -622,6 +622,8 @@ server_client_check_mouse(struct client *c, struct key_event *event)
} else if (MOUSE_RELEASE(m->b)) {
type = UP;
x = m->x, y = m->y, b = m->lb;
if (m->sgr_type == 'm')
b = m->sgr_b;
log_debug("up at %u,%u", x, y);
} else {
if (c->flags & CLIENT_DOUBLECLICK) {
@ -642,7 +644,10 @@ server_client_check_mouse(struct client *c, struct key_event *event)
log_debug("triple-click at %u,%u", x, y);
goto have_event;
}
} else {
}
/* DOWN is the only remaining event type. */
if (type == NOTYPE) {
type = DOWN;
x = m->x, y = m->y, b = m->b;
log_debug("down at %u,%u", x, y);

6
tmux.1
View File

@ -4752,6 +4752,12 @@ they will be allowed even if the pane is invisible.
Allow programs in the pane to change the window name using a terminal escape
sequence (\eek...\ee\e\e).
.Pp
.It Xo Ic allow-set-title
.Op Ic on | off
.Xc
Allow programs in the pane to change the title using the terminal escape
sequences (\ee]2;...\ee\e\e or \ee]0;...\ee\e\e).
.Pp
.It Xo Ic alternate-screen
.Op Ic on | off
.Xc

2
tmux.h
View File

@ -877,7 +877,7 @@ struct screen_sel;
struct screen_titles;
struct screen {
char *title;
char *path;
char *path;
struct screen_titles *titles;
struct grid *grid; /* grid data */

View File

@ -481,7 +481,7 @@ window_pane_update_focus(struct window_pane *wp)
struct client *c;
int focused = 0;
if (wp != NULL) {
if (wp != NULL && (~wp->flags & PANE_EXITED)) {
if (wp != wp->window->active)
focused = 0;
else {