From 5bba7b45fa8e1a6aa62cf68088702efb1fd1d059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Villeveygoux?= Date: Tue, 23 Mar 2021 18:23:46 +0100 Subject: [PATCH] Save/load the terminal window title using xterm esc sequences --- src/nnn.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nnn.c b/src/nnn.c index 89a23ef8..61897858 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -7587,6 +7587,8 @@ static bool set_tmp_path(void) static void cleanup(void) { + printf("\033[23;0t"); /* reset terminal window title */ + fflush(stdout); free(selpath); free(plgpath); free(cfgpath); @@ -8001,6 +8003,10 @@ int main(int argc, char *argv[]) } #endif + /* Save terminal window title */ + printf("\033[22;0t"); + fflush(stdout); + #ifndef NOMOUSE if (!initcurses(&mask)) #else