diff options
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index a78b330f2..ba5d386bb 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2205,14 +2205,19 @@ mch_settitle(char_u *title, char_u *icon) void mch_restore_title(int which) { + int do_push_pop = did_set_title || did_set_icon; + /* only restore the title or icon when it has been set */ mch_settitle(((which & SAVE_RESTORE_TITLE) && did_set_title) ? (oldtitle ? oldtitle : p_titleold) : 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); + if (do_push_pop) + { + // pop and push from/to the stack + term_pop_title(which); + term_push_title(which); + } } #endif /* FEAT_TITLE */ |