From 1bf49c80e734d7fdefda0686d81f95a1ce619b10 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 26 Nov 2019 04:36:31 -0800 Subject: Some of the shell script fixes as per discussion (#389) * Improved completion support for files with spaces Filenames with spaces, both generally and for session names, will now complete as expected. * Misc shell script improvements See discussion on: https://github.com/jarun/nnn/commit/1cca9e4b72b106374f203890b266f18609deefe3 --- misc/quitcd/quitcd.bash | 4 ++-- misc/quitcd/quitcd.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'misc/quitcd') diff --git a/misc/quitcd/quitcd.bash b/misc/quitcd/quitcd.bash index 5c94b11..5ea82c4 100644 --- a/misc/quitcd/quitcd.bash +++ b/misc/quitcd/quitcd.bash @@ -1,14 +1,14 @@ n () { # Block nesting of nnn in subshells - if [ "$((NNNLVL + 0))" -ge 1 ]; then + if [ "${NNNLVL:-0}" -ge 1 ]; then echo "nnn is already running" return fi # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) # To cd on quit only on ^G, export NNN_TMPFILE after the call to nnn - export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd + export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn # stty start undef diff --git a/misc/quitcd/quitcd.zsh b/misc/quitcd/quitcd.zsh index 5c94b11..5ea82c4 100644 --- a/misc/quitcd/quitcd.zsh +++ b/misc/quitcd/quitcd.zsh @@ -1,14 +1,14 @@ n () { # Block nesting of nnn in subshells - if [ "$((NNNLVL + 0))" -ge 1 ]; then + if [ "${NNNLVL:-0}" -ge 1 ]; then echo "nnn is already running" return fi # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) # To cd on quit only on ^G, export NNN_TMPFILE after the call to nnn - export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd + export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn # stty start undef -- cgit v1.2.3-70-g09d2