Open jmoore34 opened 1 year ago
I think we would absolutely welcome UX improvements to how keypresses are interpreted with our Menu
s. For file/folder completions there would still be the question if the detailed elements should rather be generated with nushell as we need to be context aware and have our own particular semantics around quoting and escaping.
I agree that we should to better here and having commandline
etc. as an escape hatch is a bit hacky.
Background
When
cd
-ing to a nested directory (or selecting a deeply nested file), you need to type "enter tab enter tab enter tab..." to repeatedly select a folder and then re-start the filepath completion within that folder.e.g. to cd to a/b/c/d, you would do
e.g.
cd a/<tab><enter to select b><tab to list directories in b><enter to select c><tab to list directories in c><enter to select d>
Desired solution
Once in interactive completion mode, pressing tab would cause the completion to enter the the hovered-over directory without ending interactive completion.
e.g.
cd a/<tab to select b and list directories within b><tab to select c and list directories within c><enter to select d>
i.e.
(For simplicity I've omitted filtering/using arrow keys to choose between directories before pressing tab)
Additionally, pressing shift+tab could go in the opposite direction, i.e. setting the current completion to its parent directory. This could even go past the initial directory (i.e. to
..
, then../..
, etc)e.g.
References
You can somewhat emulate this behavior using external tools like fzf or broot, but such tools are more heavyweight (slower) than needed for this use case since they also search unrelated directories. Implementing this in reedline would also make it easier to complete filepath arguments without needing to set up custom keybinds with
commandline
and such.Breaking changes
This shouldn't break users since, as far as I am aware, neither tab nor shift-tab are used currently within the filepath completion menu.