From 8f7b997dde6ff3aa0864bd12e7dd9f6efd9f7d75 Mon Sep 17 00:00:00 2001 From: ketmar Date: Tue, 24 Apr 2012 17:30:09 +0300 Subject: [PATCH] sterm now correctly sets window title on tab switching --- src/sterm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sterm.c b/src/sterm.c index 55fe596..1f25e54 100644 --- a/src/sterm.c +++ b/src/sterm.c @@ -373,7 +373,7 @@ typedef struct { int oldcx; int oldcy; // - char title[ESC_TITLE_SIZ]; + char title[ESC_TITLE_SIZ+1]; int titlelen; // int mouseob; @@ -902,10 +902,18 @@ static __attribute__((noreturn)) __attribute__((format(printf,1,2))) void die (c //////////////////////////////////////////////////////////////////////////////// static void switchToTerm (int idx, int redraw) { if (idx >= 0 && idx < term_count && term_array[idx] != NULL && term_array[idx] != term) { + const char *title; + // termidx = idx; term = term_array[termidx]; xseturgency(0); tfulldirt(); + // + title = term->title; + if (!title[0]) title = opt_title; + if (title == NULL) title = ""; + XStoreName(xw.dpy, xw.win, title); + // updateTabBar = 1; if (redraw) draw(1); xfixsel(); -- 2.11.4.GIT