nnn: cd on quit not working . .

. . on Mint 18.1 x64 Cinnamon, using nnn 1.0-3.

I did jump through the necessary hoops, to wit: added the code to my bash.rc file (and indeed I tried it in a user rc file and a system one); invokved nnn not with nnn but with n; started a new terminal. Also, I tried using nnn’s cd command rather than just navigating folders. But when I exit the program, my terminal remains in the folder it started.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 28 (15 by maintainers)

Most upvoted comments

The links given leads to a 404 error page 😦

— Edit —

That’s OK, it’s there : https://github.com/jarun/nnn/tree/master/scripts/quitcd

We are at v3.1 now. Please use the latest version. The instructions correspond to the latest version.

I’m not proficient enough, but I’ll give it a go when I have some time. For now, thank you for writing a wonderful tool and for your prompt feedback.

Hey, i’m using version 1.7, followed the instructions on the wiki but couldn’t get this to work on Ubuntu, bash shell. However after using export NNN_TMPFILE="/tmp/nnn" as suggested here, instead of export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" it was fixed. Is this just configuration on my machine that is affecting this?

I removed the alias and it worked! Thank you, @jarun and @Hibou57! 😄

@RaoOfPhysics, that’s a snippet you have to copy/paste in your shell initialisation script. There is one for Bash, Fish and Zsh, depending on the shell you use. Look at the link in my previous message.

I just tested with Zsh (copy/paste of quitcd.zsh and it works fine.