Preview what actions will be run in commandline mode of the CmdPal #11513

Closed
opened 2026-01-31 02:49:48 +00:00 by claunia · 9 comments
Owner

Originally created by @zadjii-msft on GitHub (Nov 20, 2020).

So we've already got an open work item tracking "display the parse error (if any) in commandline mode", #7284. What if, when we determine that the commandline is valid, we then display what commands are about to be executed, instead of the parse error?

So if you type in

nt ssh user@server.com

We'll parse that, and that won't generate an error message, it'll instead successfully turn into a newTab(commandline="ssh user@server.com") action. We'll then take that action, and call GenerateName on it, and we'll get "Open a new tab, commandline: ssh user@server.com". We'll then display that text to the user, as a preview of what they're about to run.

Originally created by @zadjii-msft on GitHub (Nov 20, 2020). So we've already got an open work item tracking "display the parse error (if any) in commandline mode", #7284. What if, when we determine that the commandline is valid, we then display what commands are about to be executed, instead of the parse error? So if you type in ``` nt ssh user@server.com ``` We'll parse that, and that won't generate an error message, it'll instead successfully turn into a `newTab(commandline="ssh user@server.com")` action. We'll then take that action, and call `GenerateName` on it, and we'll get "Open a new tab, commandline: ssh user@server.com". We'll then display _that_ text to the user, as a preview of what they're about to run.
Author
Owner

@Don-Vito commented on GitHub (Nov 20, 2020):

@zadjii-msft - we need to consider the UX as I already put the history into the palette..

@Don-Vito commented on GitHub (Nov 20, 2020): @zadjii-msft - we need to consider the UX as I already put the history into the palette..
Author
Owner

@zadjii-msft commented on GitHub (Nov 20, 2020):

Yea, I've been thinking about that. The history is definitely better - but is there a sensible way of having both these things?

This is my terrible mockup:
image

(too lazy to bold results in the mockup)

So in this case, the user is typing a command, and they could select the nt -p Ubuntu ; ... command from the history, but until they do, we'd display the error (or results) after a short delay. I'm not sure how that really feels.

Or I guess when it's successful:
image

@zadjii-msft commented on GitHub (Nov 20, 2020): Yea, I've been thinking about that. The history is definitely better - but is there a sensible way of having both these things? This is my terrible mockup: ![image](https://user-images.githubusercontent.com/18356694/99807240-d5194a00-2b04-11eb-82c9-dbcda6ffd3db.png) (too lazy to bold results in the mockup) So in this case, the user is typing a command, and they _could_ select the `nt -p Ubuntu ; ...` command from the history, but until they do, we'd display the error (or results) after a short delay. I'm not sure how that really feels. Or I guess when it's successful: ![image](https://user-images.githubusercontent.com/18356694/99807678-77393200-2b05-11eb-9631-35ec2843fd0c.png)
Author
Owner

@Don-Vito commented on GitHub (Nov 20, 2020):

@zadjii-msft - some off-topics

  1. how do you create the mockups - this is really cool!
  2. There is another aspect that I was thinking of is prediction from history.

Here how it goes:

  1. You start typing
  2. Then you go down to the history
  3. Once you navigate through the items there, the text in the search box receives a relevant suffix in a weaker font
  4. If you press tab key it makes the suffix to be a part of the search box

So you can:

  1. Write nt
  2. Go to nt -p Ubuntu; sp --tabColor #ff00ff
  3. Press tab
  4. Continue typing "; sp" to get nt -p Ubuntu; sp --tabColor #ff00ff ; sp
@Don-Vito commented on GitHub (Nov 20, 2020): @zadjii-msft - some off-topics 1. how do you create the mockups - this is really cool! 2. There is another aspect that I was thinking of is prediction from history. Here how it goes: 1. You start typing 2. Then you go down to the history 3. Once you navigate through the items there, the text in the search box receives a relevant suffix in a weaker font 4. If you press tab key it makes the suffix to be a part of the search box So you can: 1. Write nt 2. Go to nt -p Ubuntu; sp --tabColor #ff00ff 3. Press tab 4. Continue typing "; sp" to get nt -p Ubuntu; sp --tabColor #ff00ff ; sp
Author
Owner

@zadjii-msft commented on GitHub (Nov 20, 2020):

It's an app called XAML Studio, which is an absolute lifesaver.

I certainly like the "tab complete" functionality you've suggested here. I dunno how hard it'd be to actually implement, I'm not sure how hard it would be to have multiple styles of text in a single text box. Maybe there's another type of control that would allow for it, but my XAML-fu is not that strong.

@zadjii-msft commented on GitHub (Nov 20, 2020): It's an app called [XAML Studio](https://www.microsoft.com/en-us/p/xaml-studio/9ntls214tkmq?rtc=1), which is an absolute lifesaver. I certainly like the "tab complete" functionality you've suggested here. I dunno how hard it'd be to actually implement, I'm not sure how hard it would be to have multiple styles of text in a single text box. Maybe there's another type of control that would allow for it, but my XAML-fu is not that strong.
Author
Owner

@Don-Vito commented on GitHub (Nov 20, 2020):

It's an app called XAML Studio, which is an absolute lifesaver.

I certainly like the "tab complete" functionality you've suggested here. I dunno how hard it'd be to actually implement, I'm not sure how hard it would be to have multiple styles of text in a single text box. Maybe there's another type of control that would allow for it, but my XAML-fu is not that strong.

Thanks! I will try to use it!
I guess we will need to overlay some transparent label or something like this.

@Don-Vito commented on GitHub (Nov 20, 2020): > > > It's an app called [XAML Studio](https://www.microsoft.com/en-us/p/xaml-studio/9ntls214tkmq?rtc=1), which is an absolute lifesaver. > > I certainly like the "tab complete" functionality you've suggested here. I dunno how hard it'd be to actually implement, I'm not sure how hard it would be to have multiple styles of text in a single text box. Maybe there's another type of control that would allow for it, but my XAML-fu is not that strong. Thanks! I will try to use it! I guess we will need to overlay some transparent label or something like this.
Author
Owner

@Don-Vito commented on GitHub (Dec 7, 2020):

Hey. I played for an hour with this. I will open a PR for some initial step 😊

@Don-Vito commented on GitHub (Dec 7, 2020): Hey. I played for an hour with this. I will open a PR for some initial step :blush:
Author
Owner

@zadjii-msft commented on GitHub (Dec 7, 2020):

Y A Y

@zadjii-msft commented on GitHub (Dec 7, 2020): Y A Y
Author
Owner

@Don-Vito commented on GitHub (Dec 7, 2020):

CmdPalPrediction

@Don-Vito commented on GitHub (Dec 7, 2020): ![CmdPalPrediction](https://user-images.githubusercontent.com/4639110/101365312-51a17c00-38ac-11eb-9a72-de367eb3a0cd.gif)
Author
Owner

@ghost commented on GitHub (Jan 28, 2021):

:tada:This issue was addressed in #8515, which has now been successfully released as Windows Terminal Preview v1.6.10272.0.🎉

Handy links:

@ghost commented on GitHub (Jan 28, 2021): :tada:This issue was addressed in #8515, which has now been successfully released as `Windows Terminal Preview v1.6.10272.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.6.10272.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11513