29
12
I am using Ranger terminal file explorer from within a linux terminal.
Say I start from command prompt in home directory and launch ranger
user@/home/user $ ranger
ranger opens..... and within the ranger program I explore to:
/media/ubuntu/sdf675d7sf5sdfs7/some_directory
If I then hit q to quit ranger, I am dropped back to the same folder I launched ranger from. i.e.
user@/home/user $
Is it possible to quit ranger, and remain in the directory I was in with ranger, i.
user@/media/ubuntu/sdf675d7sf5sdfs7/some_directory $
2wow thats pretty clever, It never occurred to me you could issue a command to a program, terminate it with a
;
and then specify more commands after the semi-colon which - Im assuming are run at the point you closeranger
, thanks! – the_velour_fog – 2016-02-22T03:25:38.7001Consider using
.rangerdir
instead to make it hidden. Or delete it at the end,rm -d $HOME/rangerdir
. – Mateen Ulhaq – 2018-01-25T09:35:37.083This is great but it if I understand it correctly, this would mean that you have that behavior permanently. If would be nice if there was a way to have the option to exit into current ranger directory OR the directory you were in when you started ranger. – neverfox – 2018-03-21T18:15:31.540
neverfox Once you create an alias, it's up to you if you offer the selection of the directory to land in inside that alias. The selection can be made before the binary is called or after it's finished. – Gombai Sándor – 2018-03-26T18:14:20.803
Thank you for this awesome solution! I happen to be using the fish shell, so to set my alias, I used
fish_config
and added an abbreviation forranger --choosedir="$HOME/.rangerdir"; cd (cat $HOME/.rangerdir)
– rockzombie2 – 2018-11-16T05:34:29.643