Add option to run named action from settings from the command line #15046

Closed
opened 2026-01-31 04:26:57 +00:00 by claunia · 4 comments
Owner

Originally created by @Rosefield on GitHub (Sep 1, 2021).

Description of the new feature/enhancement

Currently the Command Palette shows me all of the actions that I can run, including custom ones that I have made. It would be nice to also be able to run those actions from the command line. E.g. if I have a saved action

{ "name": "Create My Layout", "command": { ... }}

I would like to be able to call it directly like wt "Create My Layout" or as part of multiple commands wt sp; sp; myAction

Proposed technical implementation details (optional)

Currently the command line parser has a subset of all possible actions as hardcoded allowed commands. The easiest thing might be to add as a special "named action" command for if the command fails to parse as something else, or more drastically make the command parser depend on the settings so it can look up actions directly.

Originally created by @Rosefield on GitHub (Sep 1, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Currently the Command Palette shows me all of the actions that I can run, including custom ones that I have made. It would be nice to also be able to run those actions from the command line. E.g. if I have a saved action ``` { "name": "Create My Layout", "command": { ... }} ``` I would like to be able to call it directly like `wt "Create My Layout"` or as part of multiple commands `wt sp; sp; myAction` <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. --> Currently the command line parser has a subset of all possible actions as hardcoded allowed commands. The easiest thing might be to add as a special "named action" command for if the command fails to parse as something else, or more drastically make the command parser depend on the settings so it can look up actions directly.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 04:26:57 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Sep 1, 2021):

Okay so I had a very similar idea in #9994. I manually stuck it to the wt action because it forced us to the subset of actions that we know work on startup (before there's a window).

I'm tempted to close this one as a dupe of that thread to consolidate discussion. They're both basically "I want to bind multiple actions to a custom subcommand". That cool?

@zadjii-msft commented on GitHub (Sep 1, 2021): Okay so I had a very similar idea in #9994. I manually stuck it to the `wt` action because it forced us to the subset of actions that we know work on startup (before there's a window). I'm tempted to close this one as a dupe of that thread to consolidate discussion. They're both basically "I want to bind multiple actions to a custom subcommand". That cool?
Author
Owner

@Rosefield commented on GitHub (Sep 1, 2021):

Looks similar enough so there is an opportunity for merging. Maybe I am reading it wrong, but I think this extends that idea in that this allows more possibilities, e.g.
choosing which window wt -w 0 MyAction, wt -w new MyAction, etc. Composition of the commands seems to be covered or at least mentioned in the other issue.

I think it would also potentially be weird to require separate command line and normal actions. Maybe the root issue is that the commandline doesn't support as many of the actions as during normal operation?

@Rosefield commented on GitHub (Sep 1, 2021): Looks similar enough so there is an opportunity for merging. Maybe I am reading it wrong, but I think this extends that idea in that this allows more possibilities, e.g. choosing which window `wt -w 0 MyAction`, `wt -w new MyAction`, etc. Composition of the commands seems to be covered or at least mentioned in the other issue. I think it would also potentially be weird to require separate command line and normal actions. Maybe the root issue is that the commandline doesn't support as many of the actions as during normal operation?
Author
Owner

@zadjii-msft commented on GitHub (Sep 8, 2021):

/dup #9994

Just to make my life a little easier, I'm merging this thread there. Thanks!

@zadjii-msft commented on GitHub (Sep 8, 2021): /dup #9994 Just to make my life a little easier, I'm merging this thread there. Thanks!
Author
Owner

@ghost commented on GitHub (Sep 8, 2021):

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 (Sep 8, 2021): 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15046