-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab completion #7202
Comments
Works on
|
I believe this is the PR that changed this functionality. The intent Dan was going for was to have the arrow keys be the menu navigation instead of the tab key by default. This is how you can circumvent this behavior. Use a keybinding like this one.
and I have
|
Using Tab to navigate is like using Alt + Tab to navigate in the desktop. It is something natural for almost every terminal user. I don't think that it is something that people have to configure. |
FWIW, I agree with you and I think this one line change should be reverted. However, I was trying to point out to you that it could be configured to act like you want it to now so you don't have to wait and see if it eventually gets reverted or not. |
Sorry if I was harsh. Thanks for helping ❤️ |
I think the core intent of the underlying change was to support filling common prefixes while avoiding the surprising automatic completion of everything should your typing narrow the search space, but I think the broken |
IMO instead of the surprising automatic completion, the default should be like how most shells work: "if there's only one result available, Tab completes, otherwise Tab completes up to the common prefix and then cycles". The keybinding thing above gets closer to that than ever before! Except for doing things when the menu is already open and you're typing more. |
I also encountered this issue today and fixed it by changing the mode of the keybind with |
i think i'm able to reproduce this in |
Hi! Cycling with the TAB key is still not working. For example |
just built the latest revision but this does not work on my end 🤔 my configshould be |
My
Could this be the issue? Do we need to configure tab cycling somehow? Maybe I missed something above. Cycling backwards with Shift+TAB works. EDIT: Also, I am on version 0.79.0. |
@dschrempf |
Yes, it could be because there are keybindings and menus in the default_config.nu. Namely, these keybindings
and this menu
I know for a fact, that for me, with |
Isn't it weird to require special configuration to make tab cycling work? |
Not if the default is to use arrow keys. Having said that, we might should change our default. |
I see! Thanks for your help! Consider my vote on the TAB-cycle side 😄 ! EDIT: It is a bit weird though that back-cycling with Shift-TAB works out of the box. I also do not see any problem with using both ways to cycle as defaults. |
For reference: Using you menu and keybinding snippet, TAB cycling works. I also noticed an inconsistency in the keybinding configuration: one list uses commas, the other doesn't. I am aware that both ways are valid syntax, but it is a bit confusing to use both syntaxes right next to each other, isn't it? |
I'm sure it came from me copy-n-pasting it into my config from someon else's example years ago. I don't pay much attention to it but I'm also not against standardizing it. I'm not sure if anyone would object to tab/shift-tab being the defaults if someone wants to take that on. I'm not sure if it's reedline's defaults or nushell's defaults that we're using right now. |
@fdncred In my case adding |
I use tab all the time. I don't understand what the issue is. I use this in my config file. menu
keybinding
|
That actually works. But, I have double |
Also, for everyone, this should works when nushell generate default configuration for us. |
I'd also be interested in having support for tab cycling by default. I like my config files clean and as small as possible. |
this missing feature has annoyed me enough 😆 |
should close #7202 # Description i have been annoyed enough by this missing feature, so let's add that to Nushell without requiring any user configuration 😏 # User-Facing Changes this PR should allow tab completion cycling everytime, without requiring the user to use the default config files or add the following keybindings to their config ```nushell { name: completion_menu modifier: none keycode: tab mode: [emacs vi_normal vi_insert] event: { until: [ { send: menu name: completion_menu } { send: menunext } { edit: complete } ] } } ``` ### 🧪 try it out from the root of the repo, one can try `<tab>` in each of the following cases: - `cargo run -- -n` to load Nushell without any config - `cargo run -- --config crates/nu-utils/src/sample_config/default_config.nu --env-config crates/nu-utils/src/sample_config/default_env.nu` to load the default configuration - `cargo run` to load the user configuration ## before - `<tab>`, `ls <tab>` and `str <tab>` only work with the second `cargo run`, i.e. when loading the default config files ## after - `<tab>` should cycle through the available commands - `ls <tab>` should cycle through the available files and directories - `str <tab>` should cycle the subcommands of `str` in all three cases # Tests + Formatting # After submitting
Describe the bug
Tab completion seems to be broken starting with version 0.71.
See this comment: https://fosstodon.org/@jntrnr/109389406197343536
How to reproduce
ls
(with space)Expected behavior
Shift + Tab moves in the other direction, but Tab seems to be broken! It should go to the next completion. This was the behavior before version 0.71.
Screenshots
No response
Configuration
❯ version | transpose key value | to md --pretty
Additional context
Tried with
--config ""
to ignore my config, but it is the same behavior.The text was updated successfully, but these errors were encountered: