]> Sergey Matveev's repositories - nnn.git/commitdiff
Show path in terminal title (#912)
authorlvgx <l@vgx.fr>
Wed, 24 Mar 2021 01:20:51 +0000 (02:20 +0100)
committerGitHub <noreply@github.com>
Wed, 24 Mar 2021 01:20:51 +0000 (06:50 +0530)
* Show path in terminal title

* Better terminal window title format

Title is now "basename (full/path)"

src/nnn.c

index b5172e7e6055e8f189e59a3818a3c4d91b10fd9a..89a23ef8c18aa7caf7d1e590087fe8d223e5ace5 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -5993,6 +5993,10 @@ begin:
                setdirwatch();
        }
 
+       /* Set terminal window title */
+       printf("\033]2;%s (%s)\007", xbasename(path), path);
+       fflush(stdout);
+
        if (g_state.selmode && lastdir[0])
                lastappendpos = selbufpos;