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 Shortcuts #8310

Closed
oncena opened this issue Nov 17, 2020 · 3 comments
Closed

Command Shortcuts #8310

oncena opened this issue Nov 17, 2020 · 3 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@oncena
Copy link

oncena commented 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.

@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 Nov 17, 2020
@zadjii-msft
Copy link
Member

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

@ghost
Copy link

ghost commented 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 ghost closed this as completed Nov 17, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed 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 Nov 17, 2020
@krave1986
Copy link

@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.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants