Show path in terminal title (#912)

* Show path in terminal title

* Better terminal window title format

Title is now "basename (full/path)"
This commit is contained in:
lvgx 2021-03-24 02:20:51 +01:00 committed by GitHub
parent f90e567a17
commit 1c2cb7fd31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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