Skip to content

Feature request: Classic popup menus with incremental filters #122

Closed

Description

I would propose to think of classic popup menus with incremental filters for
TabExpansion and history. Perhaps I want too much and this is out of scope of
this project but I know from experience and practice that this is doable and
very useful. And this is not even something unusual, even vanilla CMD console
has its history (F7) implemented as a popup menu, without filtering, though.

Current implementation of the menu is useful for relatively small numbers of
items. With many items it is rather difficult to use (in particular with a wide
console window). Cases with many items are not so rare, in my practice at
least (class name lists, custom snippets, etc.). History is another example,
if it is persistent, it will be large eventually.

I implemented something like this in another console based host, that is why I
know how useful this can be. Especially if such menus are used for history as
well and support incremental filtering on typing in them. They increase
productivity a lot.

Example of TabExpansion list

The same or similar menu could be used for command history, too.

In my case though I did not have to implement these popup menus on my own (Far
Manager provides them via its API). Otherwise, I would propose some code to use
right away. But I remember there are some TabExpansion's implemented in this
way, so examples exist, presumably.

P.S. Found it, it is PowerTab.

Activity

  1. lzybkr commented on Jun 14, 2014

    @lzybkr
    Contributor

    It's definitely in scope. You can see I played with the UI a tiny bit in the project here: https://github.com/lzybkr/PSReadLine/blob/master/TestPSReadLine/Program.cs#L11

    The current MenuComplete was quick to implement and the UI matches zsh. I haven't decided if I like it better than PowerTab, but I think having both choices will be good. The box outlines do waste some space and personally I find the PowerTab experience a little jarring, but it is cool. I expect I'll add filtering next with no UI changes, but it might be some time - it's hard to spend my free time indoors during the summer in Seattle.

  2. nightroman commented on Jun 20, 2014

    @nightroman
    ContributorAuthor

    Just a thought. If such popup lists are implemented then they may be also exposed by PSReadline for use in scripts (eventually, hopefully). Some interesting and completely new interactive scenarios will be easy to script and use.

    As for the PowerTab experience, honestly, I could not get used to it either. But, as mentioned, I implemented something myself and this turned out to be just fine. So the experience may depend on implementation, preferences (configurable?), and etc. It's not that the idea of popups in console is somewhat wrong.

  3. cspotcode commented on Jun 18, 2017

    @cspotcode

    For anyone who finds this issue, I wrote a quick module that integrates PowerTab's popup implementation with PSReadline's key handlers.

    https://www.powershellgallery.com/packages/GuiCompletion/

    Nothing fancy, but it gets the job done. Hit Ctrl+Space and the menu pops up. The menu rendering and filtering implementation is pulled from PowerTab.

  4. nightroman commented on Jun 25, 2017

    @nightroman
    ContributorAuthor

    Andrew Bradley (@cspotcode)
    This is really good! I find the default PowerTab colors weird. But fortunately, this is configurable (yet the first impression is really poor, IMHO). It would be really nice to have this built-in...

  5. cspotcode commented on Jul 3, 2017

    @cspotcode

    Roman Kuzmin 1967-2026 (@nightroman) Feel free to send me a pull request and I'll merge it! You're also welcome to become a collaborator on the repository, and I'm even willing to move the repository to a more neutral location (community Github organization?) if that makes it more palatable. https://github.com/cspotcode/PS-GuiCompletion

  6. nightroman commented on Jul 4, 2017

    @nightroman
    ContributorAuthor

    Andrew Bradley (@cspotcode)

    Thank you, I will submit a few PRs soon, I found quite a few issues that may be
    fixed or improved. I am going to use this, it is better than the UI provided by
    PSReadline. It's just me, perhaps, but I got used to such menus for years of
    using Far Manager. To me such menus work better in cases with many items and
    these cases are frequent. Also, GuiCompletion may be used for PSRealine history,
    hopefully.

    If you want you may add me as a collaborator. But I have to add that I consider
    the project as the concept proof. Ideally, it should be the part of PSReadline.
    As far as remember, some experiments were done by the author. So I would like
    to make GuiCompletion better but not to the state of art. Besides, I think
    that PowerShell is not a quite right language for this. It should be written
    in .NET (C#) because it is relatively complex, performance sensitive, etc.

  7. lzybkr commented on Jul 4, 2017

    @lzybkr
    Contributor

    I'm open to a configurable UI - but any new UI needs to use ANSI escape sequences to make it portable, and written in C#.

    The current rending does not use ANSI, but it needs to happen - either when I get some more free time or someone beats me to it.

  8. lzybkr commented on Oct 31, 2017

    @lzybkr
    Contributor

    FYI - incremental filtering has been merged, see #515 and #561. It doesn't change the UI though.

  9. daxian-dbw commented on Apr 5, 2022

    @daxian-dbw
    Member

    Windows Terminal may have terminal UI support in future and the tracking issue is microsoft/terminal#3121. PSReadLine will for sure use that when it's ready.

    Close this one as we will not use PowerTab for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions