Merge remote-tracking branch 'upstream/master' into exit-title

This commit is contained in:
Will Song
2015-01-03 12:41:42 -06:00
6 changed files with 52 additions and 15 deletions

View File

@@ -2281,21 +2281,23 @@ _ui_draw_term_title(void)
if (unread != 0) {
snprintf(new_win_title, sizeof(new_win_title),
"%c]0;%s (%d) - %s%c", '\033', "Profanity",
"/bin/echo -n \"%c]0;%s (%d) - %s%c\"", '\033', "Profanity",
unread, jid, '\007');
} else {
snprintf(new_win_title, sizeof(new_win_title),
"%c]0;%s - %s%c", '\033', "Profanity", jid,
"/bin/echo -n \"%c]0;%s - %s%c\"", '\033', "Profanity", jid,
'\007');
}
} else {
snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%c", '\033',
snprintf(new_win_title, sizeof(new_win_title), "/bin/echo -n \"%c]0;%s%c\"", '\033',
"Profanity", '\007');
}
if (g_strcmp0(win_title, new_win_title) != 0) {
// print to x-window title bar
printf("%s", new_win_title);
int res = system(new_win_title);
if (res == -1) {
log_error("Error writing terminal window title.");
}
if (win_title != NULL) {
free(win_title);
}