Command Shortcuts #11467

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

Originally created by @oncena on GitHub (Nov 17, 2020).

Hello Windows Terminal Team Members, and may I add straight away that this app is now my go-to terminal of choice given its extraordinary customization capabilities. Now that you've done a great job with the user interface and also the customizations, I've got a suggestion that would target the ease of use for this amazing app. Let's call it "Command Shortcuts". It would basically be another drop-down menu but rather than launching pre-configured tabs, it would run pre-defined commands to automate certain tasks. I'll give you an example from my own workflow: Running ssh-start, ssh-add, and then performing login to a remote machine through ssh keys (especially those with a passphrase) requires at least three lines of commands. Call me lazy but it would be amazing to have these pre-defined shortcuts. Also bundling these shortcuts with tab configurations to be run at tab start, would be next-level.

Originally created by @oncena on GitHub (Nov 17, 2020). Hello Windows Terminal Team Members, and may I add straight away that this app is now my go-to terminal of choice given its extraordinary customization capabilities. Now that you've done a great job with the user interface and also the customizations, I've got a suggestion that would target the ease of use for this amazing app. Let's call it "Command Shortcuts". It would basically be another drop-down menu but rather than launching pre-configured tabs, it would run pre-defined commands to automate certain tasks. I'll give you an example from my own workflow: Running ssh-start, ssh-add, and then performing login to a remote machine through ssh keys (especially those with a passphrase) requires at least three lines of commands. Call me lazy but it would be amazing to have these pre-defined shortcuts. Also bundling these shortcuts with tab configurations to be run at tab start, would be next-level.
claunia added the Resolution-Duplicate label 2026-01-31 02:48:26 +00:00
Author
Owner

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

You're in luck! We actually already support something like this, with the Command Palette:
image

I currently use it to do similar things as you've mentioned here, with the following actions:

        { "command": { "action": "splitPane", "split":"auto", "splitMode": "duplicate" }, "keys": [ "ctrl+alt+t" ] },

        { "command": { "action": "wt", "commandline": "new-tab --title OpenConsole cmd.exe /k #work 15 ; split-pane --title OpenConsole cmd.exe /k #work 15 ; split-pane -H cmd.exe /k media-commandline ; new-tab --title \"Symbols Script\" powershell dev\\symbols.ps1 ; new-tab -p \"Ubuntu 18.04\" ; new-tab -p \"microsoft/Terminal\" ; sp -V -p \"microsoft/Terminal\" ; sp -H -p \"microsoft/Terminal\" ; focus-tab -t 0" }, "name": "Good Morning" },

        { "command": { "action": "sendInput", "input": "bx\r" }, "keys":"ctrl+b", "name": "Build project", "icon": "🛠"},
        { "command": { "action": "sendInput", "input": "bx & #do 10 & wtd\r" }, "keys":"ctrl+alt+b", "name": "Build & deploy TerminalApp", "icon": "🏗"},
        { "command": { "action": "sendInput", "input": "vf\rgit status\r" }, "keys":"ctrl+g", "name": "git status", "icon": "🌿"},

the "Good Morning" command opens a whole bunch of tabs and splits in the current window. The "Build..." commands can be used to run a command quickly in the terminal by sending those keys as input.

As far as running those at start, you're looking for #756

/dup #5400

@zadjii-msft commented on GitHub (Nov 17, 2020): You're in luck! We actually already support something like this, with the [Command Palette](https://docs.microsoft.com/en-us/windows/terminal/command-palette): ![image](https://user-images.githubusercontent.com/18356694/99450087-e1738c00-28e5-11eb-9f4e-337b219eb30a.png) I currently use it to do similar things as you've mentioned here, with the following actions: ```jsonc { "command": { "action": "splitPane", "split":"auto", "splitMode": "duplicate" }, "keys": [ "ctrl+alt+t" ] }, { "command": { "action": "wt", "commandline": "new-tab --title OpenConsole cmd.exe /k #work 15 ; split-pane --title OpenConsole cmd.exe /k #work 15 ; split-pane -H cmd.exe /k media-commandline ; new-tab --title \"Symbols Script\" powershell dev\\symbols.ps1 ; new-tab -p \"Ubuntu 18.04\" ; new-tab -p \"microsoft/Terminal\" ; sp -V -p \"microsoft/Terminal\" ; sp -H -p \"microsoft/Terminal\" ; focus-tab -t 0" }, "name": "Good Morning" }, { "command": { "action": "sendInput", "input": "bx\r" }, "keys":"ctrl+b", "name": "Build project", "icon": "🛠"}, { "command": { "action": "sendInput", "input": "bx & #do 10 & wtd\r" }, "keys":"ctrl+alt+b", "name": "Build & deploy TerminalApp", "icon": "🏗"}, { "command": { "action": "sendInput", "input": "vf\rgit status\r" }, "keys":"ctrl+g", "name": "git status", "icon": "🌿"}, ``` the "Good Morning" command opens a whole bunch of tabs and splits in the current window. The "Build..." commands can be used to run a command quickly in the terminal by sending those keys as input. As far as running those at start, you're looking for #756 /dup #5400
Author
Owner

@ghost commented on GitHub (Nov 17, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Nov 17, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@krave1986 commented on GitHub (Jan 16, 2021):

@zadjii-msft Hi, I happend to see your answers here. I would like to have some references about \r in sendInput actions like:
{ "command": { "action": "sendInput", "input": "bx\r" }, "keys":"ctrl+b", "name": "Build project", "icon": "🛠"},
I am currently using \u000d for return in sendInput which is ASCII code.

@krave1986 commented on GitHub (Jan 16, 2021): @zadjii-msft Hi, I happend to see your answers here. I would like to have some references about `\r` in sendInput actions like: `{ "command": { "action": "sendInput", "input": "bx\r" }, "keys":"ctrl+b", "name": "Build project", "icon": "🛠"},` I am currently using `\u000d` for return in sendInput which is ASCII code.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11467