Allow commands to be previewed in the command palette #9290

Closed
opened 2026-01-31 01:50:54 +00:00 by claunia · 4 comments
Owner

Originally created by @zadjii-msft on GitHub (Jun 26, 2020).

Originally assigned to: @zadjii-msft on GitHub.

Use cases:

  • Switching schemes - I want to be able to see what the scheme will look like, before I commit to it
  • Changing opacity - I'm thinking we have a nested "Change opacity..."/["opacity: 0%", "opacity: 5%", "opacity: 10%"...] commands, and as they key through them, it updates in real time
  • Probably useful with the tab switcher

These would need to be commands that could be undo-able. Commands where we could build a "reset" command given the current state of the Terminal, and hitting esc to dismiss the palette would revert to the original state.

I'd imagine that not all commands could be previewed. Can't preview "open a new tab".

If you went from one previewable command to another of the same action type, then we don't need to reset in between. But going from a "see theme to foo"->"set opacity to 5%" commands, we'd need to undo the first, then cache the state for the second command.

Could probably have some ActionArgs implement IPreviewable, with a ActionAndArgs GenerateUndoCommand(AppLogic); method. Anything that's "preview":true would need to implement that interface.

</showerthought>

Considered use cases:

  • Switching to another color scheme
  • changing the font size
  • changing the font face
  • changing the opacity of acrylic
  • Switching tabs (like in the ATS, #6732)
Originally created by @zadjii-msft on GitHub (Jun 26, 2020). Originally assigned to: @zadjii-msft on GitHub. Use cases: * Switching schemes - I want to be able to see what the scheme will look like, _before_ I commit to it * Changing opacity - I'm thinking we have a nested "Change opacity..."/["opacity: 0%", "opacity: 5%", "opacity: 10%"...] commands, and as they key through them, it updates in real time * Probably useful with the tab switcher These would need to be commands that could be _undo-able_. Commands where we could build a "reset" command given the _current_ state of the Terminal, and hitting <kbd>esc</kbd> to dismiss the palette would revert to the original state. I'd imagine that not all commands could be previewed. Can't preview "open a new tab". If you went from one previewable command to another of the same action type, then we don't need to reset in between. But going from a "see theme to foo"->"set opacity to 5%" commands, we'd need to undo the first, then cache the state for the second command. Could probably have some `ActionArgs` implement `IPreviewable`, with a `ActionAndArgs GenerateUndoCommand(AppLogic);` method. Anything that's `"preview":true` would need to implement that interface. \</showerthought> Considered use cases: * Switching to another color scheme * changing the font size * changing the font face * changing the opacity of acrylic * Switching tabs (like in the ATS, #6732)
Author
Owner

@DHowett commented on GitHub (Jul 10, 2020):

I wonder if it's as "easy" as having the "active TerminalSettings context" and manipulating that, and then either reverting to the existing one or committing the new one as the active one.

@DHowett commented on GitHub (Jul 10, 2020): I wonder if it's as "easy" as having the "active TerminalSettings context" and manipulating that, and then either reverting to the existing one or committing the new one as the active one.
Author
Owner

@DHowett commented on GitHub (Jul 10, 2020):

So like, the command always manipulates (permanently!) the state. We just make a copy, and discard it to undo.

@DHowett commented on GitHub (Jul 10, 2020): So like, the command always manipulates (permanently!) the state. We just make a copy, and discard it to undo.
Author
Owner

@zadjii-msft commented on GitHub (Jul 10, 2020):

That's so so so much easier

@zadjii-msft commented on GitHub (Jul 10, 2020): That's so so so much easier
Author
Owner

@ghost commented on GitHub (May 25, 2021):

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

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #9794, which has now been successfully released as `Windows Terminal Preview v1.9.1445.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.9.1445.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#9290