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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Classic popup menus with incremental filters #122

Closed
nightroman opened this issue Jun 14, 2014 · 9 comments
Closed

Feature request: Classic popup menus with incremental filters #122

nightroman opened this issue Jun 14, 2014 · 9 comments
Labels
Issue-Enhancement It's a feature request.

Comments

@nightroman
Copy link
Contributor

nightroman commented Jun 14, 2014

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.

@lzybkr
Copy link
Member

lzybkr commented Jun 14, 2014

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.

@nightroman
Copy link
Contributor Author

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.

@cspotcode
Copy link

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.

@nightroman
Copy link
Contributor Author

@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...

@cspotcode
Copy link

@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

@nightroman
Copy link
Contributor Author

@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.

@lzybkr
Copy link
Member

lzybkr commented Jul 4, 2017

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.

@lzybkr
Copy link
Member

lzybkr commented Oct 31, 2017

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

@daxian-dbw
Copy link
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
Labels
Issue-Enhancement It's a feature request.
Projects
None yet
Development

No branches or pull requests

4 participants