Skip to content

[BUG] Shell detection crashes when terminal default profile setting is not a string #686

Description

@daewoongoh

Describe the bug
Zoo can crash with Provider ended the request: t.toLowerCase is not a function when the VS Code terminal default profile setting is misconfigured with a non-string value.

To Reproduce
Steps to reproduce the behavior:

  1. Open VS Code settings JSON.
  2. Set the terminal default profile to a non-string value. For example, on Windows:
    {
      "terminal.integrated.defaultProfile.windows": 1
    }
    Other invalid values such as true, [], or {} can also reproduce the issue.
  3. Run Zoo and trigger a request that causes Zoo to resolve the shell configuration.
  4. See error:
    Provider ended the request: t.toLowerCase is not a function
    

Expected behavior
Zoo should not crash when VS Code terminal profile settings contain an invalid type.

Screenshots
N/A

Video
N/A

What version of zoo are you running
3.62.0

Additional context
This seems to be a runtime type validation issue rather than a TypeScript typing issue. config.get<string>() only affects the static type, but it does not guarantee that the actual value from user settings is a string.

The current code assumes defaultProfileName is a string before calling .toLowerCase(), which can fail when the VS Code settings JSON is manually edited or corrupted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions