summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95825c8)
raw | patch | inline | side by side (parent: 95825c8)
author | noname <noname@inventati.org> | |
Fri, 25 Apr 2014 14:48:38 +0000 (18:48 +0400) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 13 May 2014 07:21:43 +0000 (09:21 +0200) |
If stdout is not flushed, printf may not terminate control string
properly. This way xterm title changes only sometimes.
Also use standard (ECMA-048) control string terminator ^[\ instead of \a.
properly. This way xterm title changes only sometimes.
Also use standard (ECMA-048) control string terminator ^[\ instead of \a.
src/screen_utils.c | patch | blob | history |
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 1c1f14b189c2cd71ac8252b7ab1aecd2adfe418a..4bb18750fcdb0d92c5e638afc8d0378f422a5fa4 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
va_start(ap,format);
char *msg = g_strdup_vprintf(format,ap);
va_end(ap);
- printf("%c]0;%s%c", '\033', msg, '\007');
+ printf("\033]0;%s\033\\", msg);
+ fflush(stdout);
g_free(msg);
} else
options.enable_xterm_title = FALSE;