-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Description
I write some long command. I need to use this frequently (or infrequently), but I don't want to have to remember all the args. I want to be able to pull it up straight from the command palette. So I want to write the command once, select it, and {perform some action}1 that lets me save it as a sendInput
action.
The action should
- immediately save it.
- provide a UI2 for immediately editing3 the name, contents of this action, because
Send "git log --graph --abbrev-commit --decorate..." to the Terminal
is not useful to anyone.
Just doing the immediate save would be a good enough start on this, to the point I'd consider that an easy starter. The UI - that's Hard, for reasons listed below.
Note
Walkthrough
As an initial version of this, it's more than good enough to just save the selected text as an action without the UI. We can iterate on the UI in follow-ups.
- Probably start with something like
dev/migrie/fhl/save-command
- We probably want to skip all the
AppCommandlineArgs
stuff for now. That's spicier. - in
TerminalPage::_HandleSaveTask
, we will want to try and save the current selection as asendInput
action, if there's nocommandline
specified. - AppActionHandlers.cpp has plenty of examples of getting the active control. Should be easy enough to get the selected text from it.
- We'll probably want to generate the name of this action (without a commandline) as "Save Task..."
- Over and above: It would be valuable to
Toast
the user with a message "Saved selected text as a new action".TerminalPage::IdentifyWindow
has an example of aToast
Footnotes
-
Obviously, easiest way is via cmdpal or keybinding. Also consider a right-click context menu entry, Request: Right-click menu inside TerminalControl (w/ Copy & Paste?) #3337 ↩
-
This has it's own challenges. It can't be a
ContentDialog
(https://github.com/microsoft/microsoft-ui-xaml/issues/3804). It could be nested in aFlyout
, maybe. Hopefully the dialog thing is limited just to ContentDialogs and not all Flyouts. It probably shouldn't be aTeachingTip
(Auto-focus window renamer textbox on open #12798). We could roll our own ContentDialog for this of course (Warn before the user runs a new commandline elevated #11308). ↩ -
Might be tricky - we'd have to hand on to an instance of the actual
Command
itself, so we can edit it... in place? and hopefully writing to the settings would then just refresh all the other name->command maps instantly. ↩
Metadata
Metadata
Assignees
Labels
Type
Projects
Status