diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-07 22:31:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-07 22:31:44 +0200 |
commit | 40385dbcdfb44885f2e9b83e1e0285aeb8a0c2a8 (patch) | |
tree | 35de952db98f597df68144ef4ab99a294177861d /src/os_unix.c | |
parent | de3b3677f7eace66be454196db0fbf710cfc8c5e (diff) | |
download | vim-git-40385dbcdfb44885f2e9b83e1e0285aeb8a0c2a8.tar.gz |
patch 8.1.0253: saving and restoring window title does not always workv8.1.0253
Problem: Saving and restoring window title does not always work.
Solution: Use the stack push and pop commands. (Kouichi Iwamoto,
closes #3059)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 94c3dc9a2..4b452b5ce 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2336,17 +2336,21 @@ mch_settitle(char_u *title, char_u *icon) /* * Restore the window/icon title. * "which" is one of: - * 1 only restore title - * 2 only restore icon - * 3 restore title and icon + * SAVE_RESTORE_TITLE only restore title + * SAVE_RESTORE_ICON only restore icon + * SAVE_RESTORE_BOTH restore title and icon */ void mch_restore_title(int which) { /* only restore the title or icon when it has been set */ - mch_settitle(((which & 1) && did_set_title) ? + mch_settitle(((which & SAVE_RESTORE_TITLE) && did_set_title) ? (oldtitle ? oldtitle : p_titleold) : NULL, - ((which & 2) && did_set_icon) ? oldicon : NULL); + ((which & SAVE_RESTORE_ICON) && did_set_icon) ? oldicon : NULL); + + // pop and push from/to the stack + term_pop_title(which); + term_push_title(which); } #endif /* FEAT_TITLE */ @@ -3412,7 +3416,9 @@ mch_exit(int r) { settmode(TMODE_COOK); #ifdef FEAT_TITLE - mch_restore_title(3); /* restore xterm title and icon name */ + // restore xterm title and icon name + mch_restore_title(SAVE_RESTORE_BOTH); + term_pop_title(SAVE_RESTORE_BOTH); #endif /* * When t_ti is not empty but it doesn't cause swapping terminal |