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

Command Palette: Action and command line mode in relation to char > #7736

Closed
thernstig opened this issue Sep 25, 2020 · 11 comments · Fixed by #7935
Closed

Command Palette: Action and command line mode in relation to char > #7736

thernstig opened this issue Sep 25, 2020 · 11 comments · Fixed by #7935
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@thernstig
Copy link

Description of the new feature/enhancement

In VS Code, pressing ctrl+shift+p opens the command palette with >.
In Windows terminal, pressing ctrl+shift+p opens the command palette without >.

But both mean the same thing i.e. if I enter some text I find commands to execute.

As I expect many users will use VS Code + Windows Terminal when developing on Windows, would it not be better to correlate these? The benefits are:

  1. > means the same thing for both apps, which decreases cognitive load.
  2. It is easier to press backspace to remove the > than it is to add the >.

I.e. I think the > should instead mean "action mode" whilst no > will mean command line mode, according to https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-3-release/ (see under "Command palette").

I realize this might have been discussed when implementing this, but in that case and if this issue is closed, it might serve as a reference to other users being confused by this unfortunate discrepancy.

@thernstig thernstig added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Sep 25, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 25, 2020
@zadjii-msft
Copy link
Member

Oh my gosh you're right, we did end up doing this backwards from VsCode.

I even had it called out in the spec to do it the other way: Cmd Palette Spec. That whole section is labeled with a bunch of "for discussion" tags, but I guess I never updated the spec to reflect the final decision-making point: #5674 (comment)

I'm now doubly on board with > being the Commandline mode key, because that's exactly what Powertoys Run picked for their "commandline mode" (whatever they're calling it)

We're definitely in a weird place here - we already shipped the CmdPal with > as the Commandline Mode prefix, so I'm not sure that we could swap them now, though, I suppose all the 1.x releases are just previews of 2.0, and we still have some runway for breaking changes...

@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Question For questions or discussion Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Oct 9, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 9, 2020
@thernstig
Copy link
Author

Glad I at least posted this then, and that it was an oversight. To make progress in the world of all that is coding, I do think a change is warranted and I am not sure many users would be angry if a change was made. The reason being that the default of pressing ctrl+shift+p would still by default end up in "action mode" just it it has the > in there, which is as I mentioned easy to delete with a backspace. It is much easier than adding > to go into "command line mode".

tldr; I think most users would find this an improvement (even if we do not take VS Code into account).

@zadjii-msft
Copy link
Member

Summoning @DHowett, @cinnamon-msft. What do y'all think - do we follow PowerToys run, or VsCode?

@cinnamon-msft
Copy link
Contributor

If we start with >, would it say "Enter a wt commandline to run" or would it still list the available command options?

@thernstig
Copy link
Author

thernstig commented Oct 11, 2020

It would list the available commad options. Exactly like in VS Code. (if the question was aimed at me)

@cinnamon-msft
Copy link
Contributor

Then I think we should follow VS Code for this. We've followed them for the key binding, might as well keep it going. :)

@DHowett
Copy link
Member

DHowett commented Oct 12, 2020

Meh, let's just flip it. It starts with > by default, and > is "action search mode".

FWIW: VS Code doesn't have a commandline invocation mode, so there's no real parallel here.

How do other popular editors handle this? How about terminal emulators?

@thernstig
Copy link
Author

@DHowett

FWIW: VS Code doesn't have a commandline invocation mode, so there's no real parallel here.

That is true, but for what it is worth it has another mode (file mode) when the > is removed.

@zadjii-msft
Copy link
Member

Thanks for the feedback y'all. I'll throw this on my 1.5 plate, so we don't ship the CmdPal with the original behavior for too long.

I'm not sure there's any other precedent for a command palette in other terminal emulators, so that's not really a factor here.

Sublime Text's "action mode" has no prefix, but also so does the "navigate to file" mode. They're just on separate keybinds. "Go to reference" (e.g. function name) is on the prefix @, from the "navigate to file" mode, and "go to line" is on :. Similar to VS Code, but I think the key difference is the ability to get to "action mode" with > in VS.

@zadjii-msft zadjii-msft added Issue-Task It's a feature request, but it doesn't really need a major design. Priority-1 A description (P1) and removed Issue-Question For questions or discussion labels Oct 13, 2020
@zadjii-msft zadjii-msft added this to the Terminal v1.5 milestone Oct 13, 2020
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 13, 2020
@zadjii-msft
Copy link
Member

Oof, this is a little trickier than just "flip the logic around" - we're going to have to fake out the placeholder text for action mode now, because it will have a literal > in the input, so XAML won't display the TextBox's PlaceholderText.

Annoying, but fixable.

@ghost ghost added the In-PR This issue has a related PR label Oct 15, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Oct 15, 2020
DHowett pushed a commit that referenced this issue Oct 15, 2020
VsCode uses `>` as its "prefix" for the equivalent of their "action
mode". This PR aligns the Terminal with their logic here. 

We have to be tricky - if we use the `>` in the actual input as the
indicator for action mode, we can't display any placeholder text in the
input to tell users to type a command. This wasn't an issue for the
commandline mode previously, because we'd stick the "prompt" in the "no
matches text" space. However, we can't do that for action mode. Instead,
we'll stick a floating text block over the input box, and when the
user's in action mode, we'll manually place a `>` into that space. When
the user backspaces the `>`, we'll remove it from that block, and switch
into commandline mode.

## Validation Steps Performed
Played with the cmdpal in lots of different modes, this finally feels
good

Closes #7736
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Oct 15, 2020
@ghost
Copy link

ghost commented Nov 11, 2020

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

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants