Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1052  / 2 Years ago, sun, may 15, 2022, 9:06:45

Expectation:



  1. open lf or nnn;

  2. navigate to a desired location there;

  3. :q

  4. $PWD is the desired location.


Reality:


The state of the parent terminal is unchanged, directory change is local to the file manager.


Question:


Am I missing something?

Is there any way to break free from ls;cd;ls;cd;ls;cd;ls;cd;... curse?

Preferably without mc or any two-pane file managers.

I only need a lightweight visual aid for navigation, nothing more.


More From » bash

 Answers
3

This seems to be something documented in source code repositories rather than in help/man pages.


There are seem to be workarounds for each file manager:



In short, every file manager has some way to export the last folder path into a temporary file and there are example scripts in the repositories to help you wrap it into a shell command that will run the file manager and use the temporary file afterwards to perform the cd automatically.


I went with lf, copying lfcd.sh from repo folder and sourcing it into my ~/.bashrc. Now I can use lfcd when I need to quickly navigate somewhere.


[#1661] Tuesday, May 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
barted

Total Points: 424
Total Questions: 103
Total Answers: 101

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
barted questions
;