misc/auto-completion/fish/nnn.fish | 2 +- misc/auto-completion/zsh/_nnn | 2 +- nnn.1 | 1 + src/nnn.c | 12 ++++++------ diff --git a/misc/auto-completion/fish/nnn.fish b/misc/auto-completion/fish/nnn.fish index fdd27f899fd3a9d921b4bb50824ef48c94521375..5452d2d4eac5063ed38a1a808752fc8b1161b1cb 100644 --- a/misc/auto-completion/fish/nnn.fish +++ b/misc/auto-completion/fish/nnn.fish @@ -42,5 +42,5 @@ complete -c nnn -s u -d 'use selection (no prompt)' complete -c nnn -s U -d 'show user and group' complete -c nnn -s V -d 'show program version and exit' complete -c nnn -s w -d 'hardware cursor mode' -complete -c nnn -s x -d 'notis, sel to system clipboard' +complete -c nnn -s x -d 'notis, sel to system clipboard, xterm title' complete -c nnn -s h -d 'show program help' diff --git a/misc/auto-completion/zsh/_nnn b/misc/auto-completion/zsh/_nnn index 9a33020c22b132119602e8b9e5c6ffb8252e5a20..8a865e8fd2a0a654186d42c5f02a0d21fd3be724 100644 --- a/misc/auto-completion/zsh/_nnn +++ b/misc/auto-completion/zsh/_nnn @@ -40,7 +40,7 @@ '(-u)-u[use selection (no prompt)]' '(-U)-U[show user and group]' '(-V)-V[show program version and exit]' '(-w)-C[hardware cursor mode]' - '(-x)-x[notis, sel to system clipboard]' + '(-x)-x[notis, sel to system clipboard, xterm title]' '(-h)-h[show program help]' '*:filename:_files' ) diff --git a/nnn.1 b/nnn.1 index 75d748430d745573e8f8763c7a37111af3424cbc..bab27e79baadbc75374601209f706258fe1b0e46 100644 --- a/nnn.1 +++ b/nnn.1 @@ -140,6 +140,7 @@ .Pp .Fl x show notis on selection cp, mv, rm completion copy path to system clipboard on select + show xterm title .Pp .Fl h show program help and exit diff --git a/src/nnn.c b/src/nnn.c index 789648709bd1edc02057e833c77e3e48bb33a009..cab29dee8e5cc826b71e13b3c1b6300cfb84a5ee 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -303,7 +303,7 @@ uint_t cursormode : 1; /* Move hardware cursor with selection */ uint_t useeditor : 1; /* Use VISUAL to open text files */ uint_t reserved3 : 3; uint_t regex : 1; /* Use regex filters */ - uint_t x11 : 1; /* Copy to system clipboard and show notis */ + uint_t x11 : 1; /* Copy to system clipboard, show notis, xterm title */ uint_t timetype : 2; /* Time sort type (0: access, 1: change, 2: modification) */ uint_t cliopener : 1; /* All-CLI app opener */ uint_t waitedit : 1; /* For ops that can't be detached, used EDITOR */ @@ -332,7 +332,7 @@ uint_t oldcolor : 1; /* Use older colorscheme */ uint_t stayonsel : 1; /* Disable auto-proceed on select */ uint_t dirctx : 1; /* Show dirs in context color */ uint_t uidgid : 1; /* Show owner and group info */ - uint_t reserved : 9; /* Adjust when adding/removing a field */ + uint_t reserved : 9; /* Adjust when adding/removing a field */ } runstate; /* Contexts or workspaces */ @@ -5914,7 +5914,7 @@ valid_parent(path, lastname); setdirwatch(); } - if (!g_state.picker) { + if (cfg.x11) { /* Set terminal window title */ r = set_tilde_in_path(path); @@ -7405,7 +7405,7 @@ " -U show user and group\n" #endif " -V show version\n" " -w place HW cursor on hovered\n" - " -x notis, sel to system clipboard\n" + " -x notis, sel to clipboard, xterm title\n" " -h show help\n\n" "v%s\n%s\n", __func__, VERSION, GENERAL_INFO); } @@ -7512,7 +7512,7 @@ } static void cleanup(void) { - if (!g_state.picker) { + if (cfg.x11) { printf("\033[23;0t"); /* reset terminal window title */ fflush(stdout); } @@ -7931,7 +7931,7 @@ read_history(g_buf); } #endif - if (!g_state.picker) { + if (cfg.x11) { /* Save terminal window title */ printf("\033[22;0t"); fflush(stdout);