Nnn: Sync subshell PWD to nnn

Created on 12 Nov 2019  路  7Comments  路  Source: jarun/nnn

Midnight Commander has a nice default feature: mc's subshell current working directory is kept in sync with mc itself. For example, you start mc, switch to subshell, cd to another directory in subshell and exit back to mc, the mc will be in that directory.

mc does this by default, no user configuration needed. It archives this by adding precmd function to the subshell, which sends pwd updates back to mc. See implementation details at https://github.com/MidnightCommander/mc/blob/master/src/subshell/common.c#L810.

It would be nice for nnn to implement this feature.

All 7 comments

Sorry, no plans to interpret shell commands run by user.

@z0rc You can write a plugin that does just that and let the plugin change the directory in nnn.

@annagrram Is there a way to change dir in running nnn from other process?

@annagrram Is there a way to change dir in running nnn from other process?

Yes. It's new in master and should be released in the next version.
You can read about it here

@annagrram just wondering if the _Controlling nnn's active directory_ section should go to the wiki. What do you say?

Well, it's tightly coupled with the plugins' mechanism, so plugin knowledge is mandatory in order to achieve this, but I guess it can't hurt to put it there as well.

Maybe add a small subsection in the wiki and link the plugin readme from there. So it would be available to people exploring the wiki.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tim77 picture tim77  路  9Comments

ralphee picture ralphee  路  6Comments

akimdi picture akimdi  路  6Comments

billop picture billop  路  5Comments

kuntau picture kuntau  路  3Comments