-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Okay, this is gonna sound crazy so bear with me. I was switching git branches, and thought, "I really do not know how to use less well, and git branch | $ grep foo each time is annoying".
Then I thought, we've got this great command palette for filtering a list of things.
As an extension, what if we could pipe a list of items to the terminal, and then have the terminal open up the command palette with those items populated in it. Then selecting one of those items would insert that text?
So something like:
git branch | wt -w 0 select-list --prefix "git checkout "
would pipe to the current window, into the command palette. --prefix "git checkout " would indicate "use this text as a prefix for whatever the selected item was".
So hitting enter on one of these items, like "dev/migrie/foo" would SendInput git checkout dev/migrie/foo to the terminal.
This encapsulates a bunch of things:
- extensions need to be able to add their own subcommands to the commandline parser
- they also need to be able to parse their own args
- extensions need to be able to open a
command paletteFilterableListView with whatever they want (a set of actions in this case. The actions would all be {sendInput(prefix+item), name=item})