diff options
author | Enan Ajmain <3nan.ajmain@gmail.com> | 2023-01-23 15:45:18 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-23 01:45:18 -0800 |
commit | b36b58d0d4869b573ca6657db0d43eed2cbdd72f (patch) | |
tree | 33174f8dd73d07ba256a1de4ff547581febfdf77 /src/nvim/os/os_win_console.c | |
parent | cb757f2663e6950e655c6306d713338dfa66b18d (diff) | |
download | rneovim-b36b58d0d4869b573ca6657db0d43eed2cbdd72f.tar.gz rneovim-b36b58d0d4869b573ca6657db0d43eed2cbdd72f.tar.bz2 rneovim-b36b58d0d4869b573ca6657db0d43eed2cbdd72f.zip |
fix(Windows): restore console title at exit #21922
Fixes #21404
Diffstat (limited to 'src/nvim/os/os_win_console.c')
-rw-r--r-- | src/nvim/os/os_win_console.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/os/os_win_console.c b/src/nvim/os/os_win_console.c index 18f6e8b37b..006e27d28f 100644 --- a/src/nvim/os/os_win_console.c +++ b/src/nvim/os/os_win_console.c @@ -10,6 +10,7 @@ # include "os/os_win_console.c.generated.h" #endif +static char origTitle[256] = { 0 }; static HWND hWnd = NULL; static HICON hOrigIconSmall = NULL; static HICON hOrigIcon = NULL; @@ -92,3 +93,15 @@ void os_icon_init(void) } } } + +/// Saves the original Windows console title. +void os_title_save(void) +{ + GetConsoleTitle(origTitle, sizeof(origTitle)); +} + +/// Resets the original Windows console title. +void os_title_reset(void) +{ + SetConsoleTitle(origTitle); +} |