]> Sergey Matveev's repositories - nnn.git/commitdiff
Save/load the terminal window title using xterm esc sequences
authorLéo Villeveygoux <l@vgx.fr>
Tue, 23 Mar 2021 17:23:46 +0000 (18:23 +0100)
committerLéo Villeveygoux <l@vgx.fr>
Wed, 24 Mar 2021 14:40:29 +0000 (15:40 +0100)
src/nnn.c

index 89a23ef8c18aa7caf7d1e590087fe8d223e5ace5..61897858d2673346d1fa88a41871bac153214a69 100644 (file)
--- 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