Skip to content

Escape characters (^[[) leak into zsh completion data causing errors #405

@SolarAquarion

Description

@SolarAquarion

Description

When using inshellisense with zsh, escape characters ( / ) leak into the shell's completion match data, causing errors in zsh's core completion functions.

Error

_setup:33: bad math expression: illegal character: ^[

This occurs in zsh's built-in _setup function (at /usr/share/zsh/functions/Completion/Base/_setup) when it tries to manipulate compstate[list] which contains embedded escape sequences from inshellisense's PTY layer.

Steps to Reproduce

  1. Install inshellisense (git build from main)
  2. Configure zsh with:
    • powerlevel10k prompt
    • zsh-autosuggestions
    • zsh-completions
    • fzf-tab
  3. Run is to start an inshellisense session
  4. Press Tab to trigger completions

Expected Behavior

Tab completions work without errors. Escape sequences from inshellisense's PTY should not leak into zsh's completion data.

Actual Behavior

Errors like _setup:33: bad math expression: illegal character: ^[ appear. Completions still function but produce noisy error output.

Additional Context

  • The issue also affects fzf-tab (-ftb-generate-complist:33: bad math expression: illegal character: ^[)
  • The escape characters appear to be injected into compstate[list] or the completion match data by inshellisense's PTY before zsh's completion system processes them
  • Disabling list-packed, list-rows-first, and list-colors via zstyle does not resolve the issue since the escape characters are in the match data itself, not the display options

Environment

  • OS: Arch Linux (CachyOS)
  • Shell: zsh 5.9
  • inshellisense: git build (main branch, 0.0.1.r1.g86bdd7b)
  • Node.js: v22.22.2
  • Terminal: various (issue reproduces in all)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions