awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.17k stars 772 forks source link

Add toolbar menu to easily toggle between options #26

Closed donnemartin closed 8 years ago

donnemartin commented 8 years ago

Toolbar Options

Some users might want to turn off fuzzy matching. I sometimes toggle this depending on what I'm doing.

On a related note, I think the current fuzzy matching works pretty well, although in some cases it actually results in more keystrokes (https://github.com/awslabs/aws-shell/issues/5). For example:

 aws> ec2 describe-inst

Fuzzy On

Imgur

Fuzzy Off

Imgur

Vi/Emacs Key Bindings

Currently aws-shell runs with Vibindings, which might not suit everyone. For SAWS and aws-shell personally I'm starting to use the Emacs mode more it feels more natural to me thinking of these apps as a command line tool rather than an editor.

TODO: With Vi bindings we might want to add info to let the user know what mode is active.

Imgur

Imgur

Single vs Multi Column Completion Menus

Some users might prefer the current multi column and others might prefer the single column. I prefer the latter it seems 'less busy' and more like what I'm accustomed to with other apps, although it could take some scrolling unlike the multi column option where you see pretty much everything.

prompt-toolkit also handles the meta info differently single vs multi. For single you see more meta right away, for multi, you only see meta for the currently highlighted completion. I've also applied pygments styles to the menu and meta, although the multi meta style doesn't seem to be taking hold.

Single Column

Imgur

Multi Column

Imgur

Single Column Meta

Imgur

Multi Column Meta

Imgur

Help Toggle

The help pane is really cool, although it does take up a lot of space. Users might not always want to see this menu--for example they might only want to see this for unfamiliar commands. Users might want to reclaim that screen real estate.

Menu On

Imgur

Menu Off

Imgur

Exit

To exit, Ctrl-D might not be obvious to some users.

Imgur

TODO

These options should probably go to a config file to save their state between sessions.

We could also make the toolbar content configurable if the number of options starts growing large.

jamesls commented 8 years ago

I think these are great additions. The UI looks great.

I plan on fixing the fuzzy search algorithm, those improvements are being tracked here: https://github.com/awslabs/aws-shell/issues/5 I do hope that eventually a prefix match will always be offered first, even with the fuzzy searching on. I think this is doable but I understand needing to have a toggle.

donnemartin commented 8 years ago

I'm getting close to wrapping up these changes and submitting a PR.

Branch: https://github.com/awslabs/aws-shell/commits/feature/26-toolbar.

jamesls commented 8 years ago

I believe this can be closed now, merged in https://github.com/awslabs/aws-shell/commit/654c93a3aa38c9344624f94922a4c1a928f201d7