Theia API Documentation v1.69.0
    Preparing search index...

    Implements

    Index

    Constructors

    Methods

    • Checks if a command contains dangerous patterns that could indicate bypass attacks. Detects:

      • Command substitution via $() or backticks
      • Process substitution via <() or >()
      • Parameter expansion with braces via ${}
      • Subshell execution when command starts with (

      Parameters

      • command: string

        The shell command to analyze

      Returns boolean

      true if the command contains dangerous patterns, false otherwise

    • Parses a shell command string into individual sub-commands using a quote-aware state-machine tokenizer. Respects single quotes, double quotes, and backslash escapes. Splits on operators &&, ||, |&, |, &, and ;, as well as newline characters outside quotes. Collapses runs of whitespace outside quotes and strips meaningless backslash escapes outside quotes (e.g. \hh). Degrades gracefully when quotes are unmatched.

      Parameters

      • command: string

        The shell command to parse

      Returns string[]

      Array of trimmed sub-commands with empty entries filtered out