[PR #16914] Add support for restoring non-terminal panes, and opening them with splitPane, newTab #31049

Closed
opened 2026-01-31 09:44:46 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/16914

State: closed
Merged: Yes


This changes NewTabArgs, SplitPaneArgs, and NewWindowArgs to accept a INewContentArgs, rather than just a NewTerminalArgs. This allows a couple things:

  • Users can open arbitrary types of panes with the existing splitPane, newWindow actions, just by passing "type": "scartchpad" (for example). This is a lot more flexible than re-defining different "openScratchpad", "openTasksPane", etc, etc actions for every kind of pane.
  • This allows us to use the existing machinery of session restore to also restore non-terminal panes.

The type property was added to newTab, splitPane, newWindow. When omitted, we still just treat the json as a blob of NewTerminalArgs.

There's not actually any other kinds of INewContentArgs in this PR (other than the placeholder GenericContentArgs). In dev/migrie/fhl/md-pane, I have a type of pane that would LOVE to add some args here. So that's forward-thinking.

There's really just two stealth types of pane for now: settings, and scratchpad. Those I DON'T have as constants or anything in this PR. They probably should be? Though, I suspect around the time of the tasks & MD panes, I'll come up with whatever structure I actually want them to take.

future considerations here

  • In the future, this should allow extensions to say "I know how to host foo content", for 3p content.
  • The wt CLI args were not yet updated to also accept --type yet. There's no reason we couldn't easily do that.
  • I considered adding ICanHasCommandline to allow arbitrary content to generate a wt commandline-serializable string. Punted on that for now.

other PRs

Closes #17014

**Original Pull Request:** https://github.com/microsoft/terminal/pull/16914 **State:** closed **Merged:** Yes --- This changes `NewTabArgs`, `SplitPaneArgs`, and `NewWindowArgs` to accept a `INewContentArgs`, rather than just a `NewTerminalArgs`. This allows a couple things: * Users can open arbitrary types of panes with the existing `splitPane`, `newWindow` actions, just by passing `"type": "scartchpad"` (for example). This is a lot more flexible than re-defining different `"openScratchpad"`, `"openTasksPane"`, etc, etc actions for every kind of pane. * This allows us to use the existing machinery of session restore to also restore non-terminal panes. The `type` property was added to `newTab`, `splitPane`, `newWindow`. When omitted, we still just treat the json as a blob of NewTerminalArgs. There's not actually any other kinds of `INewContentArgs` in this PR (other than the placeholder `GenericContentArgs`). In [`dev/migrie/fhl/md-pane`](https://github.com/microsoft/terminal/compare/dev/migrie/f/tasks-pane...dev/migrie/fhl/md-pane), I have a type of pane that would LOVE to add some args here. So that's forward-thinking. There's really just two stealth types of pane for now: `settings`, and `scratchpad`. Those I DON'T have as constants or anything in this PR. They probably should be? Though, I suspect around the time of the tasks & MD panes, I'll come up with whatever structure I actually want them to take. ### future considerations here * In the future, this should allow extensions to say "I know how to host `foo` content", for 3p content. * The `wt` CLI args were not yet updated to also accept `--type` yet. There's no reason we couldn't easily do that. * I considered adding `ICanHasCommandline` to allow arbitrary content to generate a `wt` commandline-serializable string. Punted on that for now. ## other PRs * #16170 * #16171 * #16172 * #16895 * #16914 <-- you are here Closes #17014
claunia added the pull-request label 2026-01-31 09:44:46 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31049