mgunyho / tere

Terminal file explorer
European Union Public License 1.2
1.68k stars 38 forks source link

add options to allow more GUI-like keybindings #39

Closed maznu closed 2 years ago

maznu commented 2 years ago

My muscle memory of 1990s and 2000s GUIs has taught me that Enter is "OK" and Esc is the "cancel" action. This PR proposes two command-line options:

And that's it!

bfiics commented 2 years ago

I kinda like to navigate with keys, nice one

mgunyho commented 2 years ago

Thanks for the PR! I like the idea of "cd and then exit", and alt-enter seems like a good default keyboard shortcut for that. However, the --enter-is-cd-and-exit and --esc-is-cancel options seem a bit specific. I would rather add options for full keyboard customization, and then these may be configured as desired.

mgunyho commented 2 years ago

I have now implemeted custom keyboard mappings in #57, which will be released soon. With this, you can add

--map Enter:ChangeDirAndExit,Esc:NotSearching:ExitWithoutCd

to your shell config, which will map Enter to "change to folder under cursor and exit with success" and Esc to "exit with error".

The default keyboard mapping for "cd and exit" is Alt-Enter or Ctrl-Space. I chose these because to me Alt-Enter feels consistent with the rest of the shortcuts, but it's sometimes used for other mappings (e.g. to make a window full screen), so Ctrl-Space is an alternative that I think is okay.