Terminal: Script Snips

Created on 24 Sep 2020  路  2Comments  路  Source: microsoft/terminal

Description of the new feature/enhancement

A way to save and quickly use common command line inputs. For example git commands such as:

git.exe pull --progress -v -no-rebase "origin"

Proposed technical implementation details (optional)

Add a Snips folder to the drop down next to tabs at the top. Functionality here would be edit/delete/add/reorder snippets.

From the command line Alt-Shift- would copy it to the command line and allow for immediate running.

For example
alt-shift-1 Enter would pull the snippet and run it.

Issue-Question Needs-Tag-Fix Resolution-Answered

Most helpful comment

You can already edit settings.json to bind Alt+Shift+1 to the sendInput action (https://github.com/microsoft/terminal/issues/3799) with the snippet as a parameter. https://github.com/microsoft/terminal/issues/1564 mentions that key bindings would be part of the settings UI in the future.

All 2 comments

You can already edit settings.json to bind Alt+Shift+1 to the sendInput action (https://github.com/microsoft/terminal/issues/3799) with the snippet as a parameter. https://github.com/microsoft/terminal/issues/1564 mentions that key bindings would be part of the settings UI in the future.

Indeed. sendInput is going to be our story for now, and once we get the ability to bind actions into the menu and toolbar and stuff it'll be easy to build up a compendium of snippets.

Gotta ask, though: why not use an alias in your shell? They're way more flexible than a "blast this input into the terminal" button...

Was this page helpful?
0 / 5 - 0 ratings