commit 9e78a911b35b52b50c90a0acd68ede472e0a9d94 parent b81109d117ebc5c35cdff2229c4feead55d6e832 Author: Cthulhux <github@tuxproject.de> Date: Mon, 13 Oct 2025 00:28:05 +0200 quitcd support for the rc shell https://github.com/rakitzis/rc Diffstat:
| A | misc/quitcd/quitcd.rc | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/misc/quitcd/quitcd.rc b/misc/quitcd/quitcd.rc @@ -0,0 +1,11 @@ +# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set) +# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to see. +# To cd on quit only on ^G, set NNN_TMPFILE after the nnn invocation, and make +# sure not to use a custom path. +NNN_TMPFILE='$HOME/.config/nnn/.lastd' + +fn n { + command nnn + eval `( cat $NNN_TEMPFILE ) + rm -f -- $NNN_TMPFILE +}