Ranger: Ranger not changing shell directory when I quit

Created on 9 Apr 2013  路  5Comments  路  Source: ranger/ranger

I'm using ranger and am not seeing "Change the directory of your shell after exiting ranger", it always returns to the directory I was in when I started ranger when I hit 'Q'.

I tried it with 1.5.4, via apt-get, and then cloned it from github, same result.

Am I misreading 'Change the directory of your shell after exiting ranger', ie it's by design, or possibly being an idiot (hitting the wrong key), or is this an issue?

Cheers :)

Most helpful comment

@jacknlliu no, ranger can't change its parent shell's cwd.
You might want to take a look at "deer" if you run zsh or try sourcing ranger: . ranger.

All 5 comments

Hi, you need to use the option --choosedir for that, combined with using "cd" after ranger quits, all wrapped in a shell function. Here is an example for bash: https://github.com/hut/ranger/blob/master/doc/examples/bash_automatic_cd.sh

Ah, thanks a lot. Great file browser, btw.

Is it possible that add a keyboard shortcut for this action?

@jacknlliu no, ranger can't change its parent shell's cwd.
You might want to take a look at "deer" if you run zsh or try sourcing ranger: . ranger.

@toonn Thank you very much! I find the deer which use c shortcut for this function.

Was this page helpful?
0 / 5 - 0 ratings