Skip to content

Schema does not allow actions without arguments in verbose form #11332

Open

Description

Windows Terminal version (or Windows build number)

1.9.1942.0

Other Software

No response

Steps to reproduce

Bind any 'shortcut action' using the following syntax:

{
  "command": {
    "action": "toggleAlwaysOnTop" // Most of the toggle actions qualify
  },
  "keys": "ctrl+alt+shift+§" // Any key combination
}

Expected Behavior

The schema should allow this, it's a working syntax.

Actual Behavior

It's considered invalid, with two problems:

  • Missing property "delta".
    Arguments corresponding to an Adjust Font Size Action

  • String does not match the pattern of "adjustFontSize".

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Sep 25, 2021
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Sep 25, 2021
  3. elsaco commented on Sep 26, 2021

    @elsaco

    Sean Jacobs (@Sophismata) please try

    { "command": "toggleAlwaysOnTop", "keys": "ctrl+alt+shift+§" }

  4. Sophismata commented on Sep 27, 2021

    @Sophismata
    Author

    Elsaco (@elsaco)
    That will work, but it doesn't stop the schema being in error. Either:

    1. The error message should be fixed to indicate a shortcut action should not be defined as an object, but as a string, or;
    2. Long-form action definitions should be accepted.
  5. zadjii-msft commented on Sep 27, 2021

    @zadjii-msft
    Member

    Yea, sure this is a bug in the schema I suppose.

  6. added
    Area-SchemaThings that have to do with the json schema.
    Help WantedWe encourage anyone to jump in on these.
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    on Sep 27, 2021
  7. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Sep 27, 2021
  8. elsaco commented on Sep 27, 2021

    @elsaco

    Sean Jacobs (@Sophismata) command is missing argument(s):

    { "command": { "action": "toggleAlwaysOnTop" }, "keys": "ctrl+alt+shift+§" }

    It should be something like:

    { "command": { "action": "toggleAlwaysOnTop", "argument": "some_value_here" }, "keys": "ctrl+alt+shift+§" }

    I'm not sure "toggleAlwaysOnTop" takes any arguments.

  9. zadjii-msft commented on Sep 27, 2021

    @zadjii-msft
    Member

    Technically, { "command": { "action": "toggleAlwaysOnTop" }, "keys": "ctrl+alt+shift+§" } is valid, it's the same as { "command": "toggleAlwaysOnTop", "keys": "ctrl+alt+shift+§" }. The bug here is that the schema doesn't validate that as valid. you don't need the long form for anything without args, but it will work with the Terminal.

  10. Sophismata commented on Sep 28, 2021

    @Sophismata
    Author

    I went over the schema last night, found the issue (and also why the error reporting is off, it's because AdjustFontSize is the first seemingly-valid schema for the verbose form action).

    I'll fork and submit a PR if people are fine with that.

    Sadly the language being used for command / action is really inconsistent. The actions array holds commands, which themselves contain either actions or additional commands.

    Edit: actually there are some more schema bugs lurking around. I'll take a look at the other schema issues and see what I can hit.

  11. removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Oct 15, 2021
  12. DanPinGF commented on Dec 9, 2021

    @DanPinGF

    Try adding /logs

  13. Weichenleeeee123 commented on Jul 16, 2026

    @Weichenleeeee123
    Contributor

    I can reproduce this on the current main schema: the short no-argument form validates, while the equivalent verbose object form does not. I couldn't find an assignee, linked PR, or follow-up to the 2021 discussion, so I'd like to work on a narrow schema fix with a regression check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SchemaThings that have to do with the json schema.Help WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions