28 ms·
First of all: when using a mouse 'a click would open a directory or a file just the same'. A mouse/trackpad has pretty much one button (or equivalent) dedicated
by throwaway053934 8y ago
First of all: when using a mouse 'a click would open a directory or a file just the same'.
A mouse/trackpad has pretty much one button (or equivalent) dedicated to interaction, so it is expected to overload some functions on it. Besides, "navigation" with the mouse is a different thing: you don't need to "move" the selection so opening is a clear voluntary decision, decoupled from navigation.
But focusing back on keyboard operation...
It is true that many text based file managers do this 'open file on right navigation move'. In my opinion that doesn't make it right: I personally consider a bad thing that can lead to startling, unnecessary and potentially sensitive application launches; a separation between movement (hjkl, arrows) and opening (obvious choice here, <Return>) is a sensible design.
Another point of view: the unwanted file-open-by-mistake situations are a form of involuntary file previews. As nnn's own 'design considerations' state [0], previews are to be avoided: "previewing ... is a wastage", potential "slow/faulty ... access makes the experience very painful" and "Users should see only what they explicitly want to see".
Lastly, there is an important aspect that mitigates the problem for 'most file managers': customization.
Here's a quick glance at the players in this text-fm arena:
- ranger and vifm, the larger managers: a cursory look in their help/configs hints that they can be heavily customized
- out of the box ranger displays a preview of the selected file; that acts a big visual hint that you don't need to 'navigate' further; however I agree that default previews are bad
- ranger and vifm remember the position along the path, so you don't get shunted moving back down
- noice has about the same behavior as nnn (nnn was forked from it), but at least it has a standard suckless style config.h header allowing customization by recompiling
- speaking of suckless style, a last resort solution is to do just that with nnn, making your own fork: its header largely keeps the structure of the original
And here are examples that work more along the lines I prefer:
- rover has the best behavior IMO: it can be similarly configured using environment variables, but by default it uses hjkl simply for navigation and NOTHING ELSE; it has separate, dedicated keys for open, preview or other things
- midnight commander has the same separation: arrows (actually just up/down) strictly for navigation (in local dir ONLY, no less); explicit directory navigation and opening with <Return>; there is no implicit 'file open'
[0] https://github.com/jarun/nnn/wiki/nnn-design-considerations https://github.com/jarun/nnn/wiki/nnn-design-considerations