duc icon indicating copy to clipboard operation
duc copied to clipboard

Way to change to directory exploring in ui upon quit?

Open OriginalPenguin opened this issue 5 years ago • 2 comments

Is there a feature to change to the directory you are currently exploring upon quitting, so your shell leaves you in the directory you are on when you quit?

OriginalPenguin avatar Jun 22 '20 05:06 OriginalPenguin

Quoting OriginalPenguin (2020-06-22 07:58:15)

Is there a feature to change to the directory you are currently exploring upon quitting, so your shell leaves you in the directory you are on when you quit?

Not without some kind of wrapper script trickery, I think: a subprocess can not change the CWD of your shell, only the shell itself can do that. What would be possible is to spawn a new temporal shell in that directory, and when you exit that shell, return to Duc or to your previous shell.

zevv avatar Jun 22 '20 06:06 zevv

"Ico" == Ico Doornekamp [email protected] writes:

Ico> Quoting OriginalPenguin (2020-06-22 07:58:15)

Is there a feature to change to the directory you are currently exploring upon quitting, so your shell leaves you in the directory you are on when you quit?

Ico> Not without some kind of wrapper script trickery, I think: a Ico> subprocess can not change the CWD of your shell, only the shell Ico> itself can do that. What would be possible is to spawn a new Ico> temporal shell in that directory, and when you exit that shell, Ico> return to Duc or to your previous shell.

I think the principle of least surprise might be to have a flag that prints the duc CWD on exit as the last thing, so you can cut and paste it more easily. As Ico says, changing the current shell is hard and would not be an expected thing.

John

l8gravely avatar Jun 26 '20 12:06 l8gravely