aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/fzcd
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-31 22:26:20 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-31 22:26:20 +0530
commitc01857cddbc18798571f6d382e01e842684a491a (patch)
treee3ddf5d14adcc85d03904f413b5255af727493e8 /plugins/fzcd
parent2d27902ac0e4f31c58d08aff3ba10f6a6d6af8e3 (diff)
downloadnnn-c01857cddbc18798571f6d382e01e842684a491a.tar.gz
Fix fzcd at /, minot refactor
Diffstat (limited to 'plugins/fzcd')
-rwxr-xr-xplugins/fzcd6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/fzcd b/plugins/fzcd
index 9e93969..5e0b5f0 100755
--- a/plugins/fzcd
+++ b/plugins/fzcd
@@ -32,5 +32,9 @@ if [ -n "$sel" ]; then
# Remove "./" prefix if it exists
sel="${sel#./}"
- nnn_cd "$PWD/$sel"
+ if [ "$PWD" = "/" ]; then
+ nnn_cd "/$sel"
+ else
+ nnn_cd "$PWD/$sel"
+ fi
fi