support ignore osc 2 after user specify pane title

pull/3930/head
cache-miss 2024-04-09 23:17:33 +08:00
parent 4bb6da75ba
commit 887cdccacf
3 changed files with 4 additions and 2 deletions

View File

@ -212,6 +212,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'T')) {
title = format_single_from_target(item, args_get(args, 'T'));
if (screen_set_title(&wp->base, title)) {
wp->base.ignore_osc_2 = 1;
notify_pane("pane-title-changed", wp);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);

View File

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

3
tmux.h
View File

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