microsoft / microsoft/inshellisense
Esc (and other keys) delivered with ~1-2s latency to TUI apps while inshellisense is active
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.7k
- Forks
- 256
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 11
Description
Description
When inshellisense is active in my shell, keys sent to a full-screen TUI application running in the same terminal are noticeably delayed. The clearest reproducer is the Esc key in a TUI that reacts to it (e.g. interrupt in opencode / opencode2): the key press is eventually delivered, but it takes roughly 1–2 seconds before the application reacts. Disabling inshellisense removes the delay entirely.
I am not sure whether this is inherent to the way is wraps the PTY, or something that can be tuned (e.g. an ESC / escape-sequence disambiguation timeout), so I am reporting it rather than proposing a fix.
Steps to reproduce
- Shell with inshellisense active (zsh, source of
~/.local/share/inshellisense/init/zsh/init.zshin.zshrc). - Start a TUI app in that terminal that has an observable
Escaction, for example opencode2, and start a long-running turn. - Press
Escand observe: the action only takes effect after ~1–2 s. - Comment out the inshellisense init line, start a new shell, repeat step 3 in the same app/terminal/session: the action is instant.
I have also observed this in lazygit/lazydocker-style TUIs, though those are less precise to time.
Expected behavior
Either keys are delivered to the wrapped application without a user-visible delay, or there is a documented configuration option to shorten/disable the delay (e.g. not intercepting Esc / reducing the escape-sequence timeout).
Environment
- inshellisense:
0.0.4(Homebrew,/opt/homebrew/bin/is) - OS: macOS 27.0 (build 26A428), arm64
- Terminal: Ghostty
- Shell: zsh
- Affected app observed: opencode2
v2.0.3(TUI)
Related
- #411 — TUI applications (lazygit, lazydocker) have broken layout when running inside an inshellisense session
- #418 — Up/Down arrows navigate suggestions instead of shell history
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the zsh entry point at ~/.local/share/inshellisense/init/zsh/init.zsh and trace how inshellisense wraps the PTY used by TUI applications. Reproduce with opencode2 or lazygit, then repeat with the init line disabled to compare Esc delivery. Done means TUI keypresses are immediate, or a documented option controls the delay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, zsh
- Domain
- cli, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100