[PR #3825] [MERGED] Add support for new panes with specifc profiles and other settings overrides #25521

Open
opened 2026-01-31 09:10:02 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3825
Author: @zadjii-msft
Created: 12/3/2019
Status: Merged
Merged: 12/9/2019
Merged by: @undefined

Base: masterHead: dev/migrie/f/new-terminal-args


📝 Commits (10+)

  • 6752b1a Basic POC - you can add profile, commandline, startingDirectory to override a profile in a newTab command
  • 9474240 Add a 'splitPane' keybinding that can be used for splitting a pane either vertically or horizontally
  • fb93105 Update documentation too
  • 451aaab Good lord this is important
  • 31a9046 Add a test too, though I have no idea if it works
  • b5a264b "style" -> "split"
  • e0cd014 pr comments from carlos
  • de60a30 Merge remote-tracking branch 'origin/master' into dev/migrie/f/splitPane-action
  • 9f93a53 Merge remote-tracking branch 'origin/master' into dev/migrie/f/new-terminal-args
  • 9eac8a6 Merge branch 'dev/migrie/f/splitPane-action' into dev/migrie/f/new-terminal-args

📊 Changes

15 files changed (+718 additions, -171 deletions)

View changed files

📝 doc/cascadia/profiles.schema.json (+28 -5)
📝 src/cascadia/LocalTests_TerminalApp/KeyBindingsTests.cpp (+35 -65)
📝 src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp (+308 -0)
src/cascadia/LocalTests_TerminalApp/TestUtils.h (+53 -0)
📝 src/cascadia/TerminalApp/ActionArgs.cpp (+1 -0)
📝 src/cascadia/TerminalApp/ActionArgs.h (+66 -9)
📝 src/cascadia/TerminalApp/ActionArgs.idl (+13 -3)
📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+3 -10)
📝 src/cascadia/TerminalApp/AppKeyBindings.h (+2 -0)
📝 src/cascadia/TerminalApp/AppKeyBindingsSerialization.cpp (+3 -1)
📝 src/cascadia/TerminalApp/AppLogic.cpp (+1 -1)
📝 src/cascadia/TerminalApp/CascadiaSettings.cpp (+166 -29)
📝 src/cascadia/TerminalApp/CascadiaSettings.h (+5 -1)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+32 -45)
📝 src/cascadia/TerminalApp/TerminalPage.h (+2 -2)

📄 Description

Summary of the Pull Request

This enables the user to set a number of extra settings in the NewTab and SplitPane ShortcutActions, that enable customizing how a new terminal is created at runtime. The following four properties were added:

  • profile
  • commandline
  • tabTitle
  • startingDirectory

profile can be used with either a GUID or the name of a profile, and the action will launch that profile instead of the default.

commandline, tabTitle, and startingDirectory can all be used to override the profile's values of those settings. This will be more useful for #607.

With this PR, you can make bindings like the following:


{ "keys": ["ctrl+a"], "command": { "action": "splitPane", "split": "vertical" } },
{ "keys": ["ctrl+b"], "command": { "action": "splitPane", "split": "vertical", "profile": "{6239a42c-1111-49a3-80bd-e8fdd045185c}" } },
{ "keys": ["ctrl+c"], "command": { "action": "splitPane", "split": "vertical", "profile": "profile1" } },
{ "keys": ["ctrl+d"], "command": { "action": "splitPane", "split": "vertical", "profile": "profile2" } },
{ "keys": ["ctrl+e"], "command": { "action": "splitPane", "split": "horizontal", "commandline": "foo.exe" } },
{ "keys": ["ctrl+f"], "command": { "action": "splitPane", "split": "horizontal", "profile": "profile1", "commandline": "foo.exe" } },
{ "keys": ["ctrl+g"], "command": { "action": "newTab" } },
{ "keys": ["ctrl+h"], "command": { "action": "newTab", "startingDirectory": "c:\\foo" } },
{ "keys": ["ctrl+i"], "command": { "action": "newTab", "profile": "profile2", "startingDirectory": "c:\\foo" } },
{ "keys": ["ctrl+j"], "command": { "action": "newTab", "tabTitle": "bar" } },
{ "keys": ["ctrl+k"], "command": { "action": "newTab", "profile": "profile2", "tabTitle": "bar" } },
{ "keys": ["ctrl+l"], "command": { "action": "newTab", "profile": "profile1", "tabTitle": "bar", "startingDirectory": "c:\\foo", "commandline":"foo.exe" } }

References

This is a lot of work that was largely started in pursuit of #607. We want people to be able to override these properties straight from the commandline. While they may not make as much sense as keybindings like this, they'll make more sense as commandline arguments.

PR Checklist

Validation Steps Performed

There are tests 🎉

Manually added some bindings, they opened the correct profiles in panes/tabs


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/3825 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 12/3/2019 **Status:** ✅ Merged **Merged:** 12/9/2019 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/f/new-terminal-args` --- ### 📝 Commits (10+) - [`6752b1a`](https://github.com/microsoft/terminal/commit/6752b1a43c194193f3a6fd058459ea495438955d) Basic POC - you can add profile, commandline, startingDirectory to override a profile in a newTab command - [`9474240`](https://github.com/microsoft/terminal/commit/9474240cbb382f7e0ef5b43b42ce70b8969b2ce0) Add a 'splitPane' keybinding that can be used for splitting a pane either vertically or horizontally - [`fb93105`](https://github.com/microsoft/terminal/commit/fb93105c7f4d94adab6552b73bc9c25e861d66b5) Update documentation too - [`451aaab`](https://github.com/microsoft/terminal/commit/451aaabcb68cb3f99232cf50664956bcbce96706) Good lord this is important - [`31a9046`](https://github.com/microsoft/terminal/commit/31a9046defccdb6e2e18e3fb0df62546beab2abc) Add a test too, though I have no idea if it works - [`b5a264b`](https://github.com/microsoft/terminal/commit/b5a264b4caba6a77f22d8501b9be1933aeccdc8e) "style" -> "split" - [`e0cd014`](https://github.com/microsoft/terminal/commit/e0cd0148e3b6bdcc5f068b58232b593d94211273) pr comments from carlos - [`de60a30`](https://github.com/microsoft/terminal/commit/de60a3048f732c786ba5fd09ff3119e9c9b0d9cf) Merge remote-tracking branch 'origin/master' into dev/migrie/f/splitPane-action - [`9f93a53`](https://github.com/microsoft/terminal/commit/9f93a536c40591be13bfa924b7b478e61a3faab1) Merge remote-tracking branch 'origin/master' into dev/migrie/f/new-terminal-args - [`9eac8a6`](https://github.com/microsoft/terminal/commit/9eac8a62472d17f6a4c7617d5b3708ac7c06d725) Merge branch 'dev/migrie/f/splitPane-action' into dev/migrie/f/new-terminal-args ### 📊 Changes **15 files changed** (+718 additions, -171 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/profiles.schema.json` (+28 -5) 📝 `src/cascadia/LocalTests_TerminalApp/KeyBindingsTests.cpp` (+35 -65) 📝 `src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp` (+308 -0) ➕ `src/cascadia/LocalTests_TerminalApp/TestUtils.h` (+53 -0) 📝 `src/cascadia/TerminalApp/ActionArgs.cpp` (+1 -0) 📝 `src/cascadia/TerminalApp/ActionArgs.h` (+66 -9) 📝 `src/cascadia/TerminalApp/ActionArgs.idl` (+13 -3) 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+3 -10) 📝 `src/cascadia/TerminalApp/AppKeyBindings.h` (+2 -0) 📝 `src/cascadia/TerminalApp/AppKeyBindingsSerialization.cpp` (+3 -1) 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/CascadiaSettings.cpp` (+166 -29) 📝 `src/cascadia/TerminalApp/CascadiaSettings.h` (+5 -1) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+32 -45) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+2 -2) </details> ### 📄 Description ## Summary of the Pull Request This enables the user to set a number of extra settings in the `NewTab` and `SplitPane` `ShortcutAction`s, that enable customizing how a new terminal is created at runtime. The following four properties were added: * `profile` * `commandline` * `tabTitle` * `startingDirectory` `profile` can be used with either a GUID or the name of a profile, and the action will launch that profile instead of the default. `commandline`, `tabTitle`, and `startingDirectory` can all be used to override the profile's values of those settings. This will be more useful for #607. With this PR, you can make bindings like the following: ```json { "keys": ["ctrl+a"], "command": { "action": "splitPane", "split": "vertical" } }, { "keys": ["ctrl+b"], "command": { "action": "splitPane", "split": "vertical", "profile": "{6239a42c-1111-49a3-80bd-e8fdd045185c}" } }, { "keys": ["ctrl+c"], "command": { "action": "splitPane", "split": "vertical", "profile": "profile1" } }, { "keys": ["ctrl+d"], "command": { "action": "splitPane", "split": "vertical", "profile": "profile2" } }, { "keys": ["ctrl+e"], "command": { "action": "splitPane", "split": "horizontal", "commandline": "foo.exe" } }, { "keys": ["ctrl+f"], "command": { "action": "splitPane", "split": "horizontal", "profile": "profile1", "commandline": "foo.exe" } }, { "keys": ["ctrl+g"], "command": { "action": "newTab" } }, { "keys": ["ctrl+h"], "command": { "action": "newTab", "startingDirectory": "c:\\foo" } }, { "keys": ["ctrl+i"], "command": { "action": "newTab", "profile": "profile2", "startingDirectory": "c:\\foo" } }, { "keys": ["ctrl+j"], "command": { "action": "newTab", "tabTitle": "bar" } }, { "keys": ["ctrl+k"], "command": { "action": "newTab", "profile": "profile2", "tabTitle": "bar" } }, { "keys": ["ctrl+l"], "command": { "action": "newTab", "profile": "profile1", "tabTitle": "bar", "startingDirectory": "c:\\foo", "commandline":"foo.exe" } } ``` ## References This is a lot of work that was largely started in pursuit of #607. We want people to be able to override these properties straight from the commandline. While they may not make as much sense as keybindings like this, they'll make more sense as commandline arguments. ## PR Checklist * [x] Closes #998 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated ## Validation Steps Performed There are tests 🎉 Manually added some bindings, they opened the correct profiles in panes/tabs --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:10:02 +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#25521