Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

support tab completion cycling #10199

Merged
merged 1 commit into from Sep 4, 2023

Conversation

amtoine
Copy link
Member

@amtoine amtoine commented Sep 3, 2023

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

    {
        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

@amtoine amtoine mentioned this pull request Sep 3, 2023
@amtoine amtoine force-pushed the support-tab-completion-cycling branch from 07e9fbb to 03d4f74 Compare September 3, 2023 09:52
@amtoine
Copy link
Member Author

amtoine commented Sep 3, 2023

just amending the commit message, it was not... professional 馃憖 馃槅

@fdncred
Copy link
Collaborator

fdncred commented Sep 3, 2023

If you're going to enable tab, you should probably also enable shift-tab to go backwards through the list.

  {
    name: completion_menu_previous
    modifier: shift
    keycode: backtab
    mode: [emacs vi_normal vi_insert]
    event: { send: menuprevious }
  }

@fdncred
Copy link
Collaborator

fdncred commented Sep 3, 2023

@amtoine ah, ok. thanks. seems odd that we'd have shift-tab and not tab. probably an oversight on our part. i'm good with landing this.

@fdncred fdncred merged commit fedd879 into nushell:main Sep 4, 2023
19 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Sep 4, 2023

Thanks!

@fdncred fdncred added the pr:release-note-mention Addition/Improvement to be mentioned in the release notes label Sep 4, 2023
@amtoine amtoine deleted the support-tab-completion-cycling branch September 4, 2023 16:31
@amtoine
Copy link
Member Author

amtoine commented Sep 4, 2023

ah, ok. thanks. seems odd that we'd have shift-tab and not tab. probably an oversight on our part. i'm good with landing this.

might have splitted through my config sync PR 馃憖

@amtoine amtoine mentioned this pull request Sep 9, 2023
amtoine added a commit to nushell/nushell.github.io that referenced this pull request Sep 17, 2023
this commit removes
| author        | description                                                | url                                                     |
| ------------- | ---------------------------------------------------------- | ------------------------------------------------------- |
| @kubouch      | Add NU_VERSION environment variable on startup             | [#10177](nushell/nushell#10177) |
| @mastermach50 | changed default env file to use $nu.home_path to find home | [#10192](nushell/nushell#10192) |
| @amtoine      | support tab completion cycling                             | [#10199](nushell/nushell#10199) |

because i'm not sure they are as interesting as the conditional sourcing
and the accessibility with screen reader friendly errors.
sholderbach added a commit to nushell/nushell.github.io that referenced this pull request Sep 19, 2023
* Create 2023-09-19-nushell_0_85_0.md

* add blurb about uutils/coreutils integration

* add the full template for the release notes

this commit also breaks the paragraph about uutils into multiple lines.

* add the raw table of contributions

* remove the bump / dependabot commits

* isolate the fixes

* more updates

* put all the PRs in proto sections

* move uutils PR to the correct section

* add TODOs and start completing some sections

* add the raw list of breaking changes

* add the full changelog

* write the "bug fixes" section

* fix a section title

* write the "documentation" section

* write the "making nushell better" section

this commit removes
| author        | description                                                | url                                                     |
| ------------- | ---------------------------------------------------------- | ------------------------------------------------------- |
| @kubouch      | Add NU_VERSION environment variable on startup             | [#10177](nushell/nushell#10177) |
| @mastermach50 | changed default env file to use $nu.home_path to find home | [#10192](nushell/nushell#10192) |
| @amtoine      | support tab completion cycling                             | [#10199](nushell/nushell#10199) |

because i'm not sure they are as interesting as the conditional sourcing
and the accessibility with screen reader friendly errors.

* write the "help with tests" section

* write the "changes to commands" section

* format and compact tables in the source

* write the "table themes" section

* write the `echo` section

* write the "python operators removal" section

* update the full changelog

* add proper uutils blog link

* Adds a note about mimalloc being default now (#1063)

* notes about history isolation changes

Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>

* type-o in sourcing and using

* `float` instead of `decimal` (#1064)

* `float` instead of `decimal`

* fix oopsie

* Breaking change markers

* Has nothing to do with pure documentation

* Add new commands section

* Deprecation section/ link new commands

* Fix `from` commands in the STD

* Fix subcommand std imports

* Mention removal of deprecated `--string`

* Refactor const section (#1068)

* Update 2023-09-19-nushell_0_85_0.md

Move code to code block

* add link to uutils blog post

* Small formulation tweaks to breaking changes

* cleanup dmatos part

* change link to our blogpost

* Add excerpt

* Excerpt in metadata

* Fix emphasis

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: amtoine <stevan.antoine@gmail.com>
Co-authored-by: Filip Andersson <17986183+FilipAndersson245@users.noreply.github.com>
Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:release-note-mention Addition/Improvement to be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab completion
2 participants