leo-arch / clifm

The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell.
https://github.com/leo-arch/clifm/wiki
GNU General Public License v2.0
1.35k stars 39 forks source link

no directory prediction after .. buf after ... #263

Closed muellerto closed 1 year ago

muellerto commented 1 year ago

Describe the bug No, not a bug.

But when I type ... I get a correct prediction of the destination directory. When I type .. I get instead a suggestion of a path. The suggestion happens also when the suggested path (which comes from history) doesn't exist.

To Reproduce I don't use the b command very often. Instead I use .. and ... and .... a lot. The prediction on the right side helps a lot to see what will happen, that's indeed a great feature.

But when I type only .. it's different. In this case a path is taken from the history, it's then not a prediction but a suggestion. This leads to three minor problems: a) you have to learn this b) you must know yourself where .. will end up - OK, you have the current working directory one line above c) the suggested path can be wrong (and indeed this is often the case)

In the following picture I typed .., the path /Tools/ is suggested. But indeed the parent directory has no Tools anywhere:

1 Catalog  1 d/rwx.r-x.r-x 1050202:1049089 2023-11-20 11:08:06 0B
----------------------------------------------------------------------------------------------
[1] 11:14 tm:DES-TM-003 /e/work/Dev/18_6_BLE/Build/Als21/Server/JSON/Schemas
<0> $ ../Tools/

What happens now when I use the suggestion?

1 Schemas  1 d/rwx.r-x.r-x 1050202:1049089 2022-11-03 10:34:36 0B
----------------------------------------------------------------------------------------------
[1] 11:14 tm:DES-TM-003 /e/work/Dev/18_6_BLE/Build/Als21/Server/JSON
<0> $ ../Tools/
cd: ../Tools/: No such file or directory
[1] 11:18 tm:DES-TM-003 /e/work/Dev/18_6_BLE/Build/Als21/Server/JSON
<1> $

Not good. I understand that history is an important feature. But here it's counterproductive. It leads to a wrong result.

Expected behavior General, if a history entry should be used to complete a user input it should only then be used as a suggestion when the execution has at least the potential to be successful. May be this could be difficult to find out but in the case of a directory change that should always be easy to check. This will lead to the situation that .. in directory A will show a different suggestion than .. in directory B, and that will be right.

I ask my brain also about the difference between .. and ... - I for my taste would rather see the same prediction as after ... also already after .. That's easy to understand: the user sees what will happen. Indeed I almost never use the suggestion from history (especially because it's not safe). Perhaps an option like "use suggestions from history for .." would be good, and when this option is off .. should behave like ... and ....

Desktop

leo-arch commented 1 year ago

Hi @muellerto. Done for ... What about a single dot? Should it suggest the current directory, or is it maybe too much?

muellerto commented 1 year ago

Yes, I've seen that already a single dot leads to the suggestion. Let it as is. That suggestion doesn't hurt.

leo-arch commented 1 year ago

Great! So, if .. is working as intended, I guess we can close this issue then.