Skip to content

fix: disable zsh history expansion to prevent commands with ! from failing (#807)#4926

Merged
kevinvandijk merged 3 commits intoKilo-Org:mainfrom
YuriNachos:fix/zsh-history-expansion-807
Feb 11, 2026
Merged

fix: disable zsh history expansion to prevent commands with ! from failing (#807)#4926
kevinvandijk merged 3 commits intoKilo-Org:mainfrom
YuriNachos:fix/zsh-history-expansion-807

Conversation

@YuriNachos
Copy link
Contributor

Summary

Fixes #807

Added setopt NO_BANG_HIST to the zsh initialization in ShellIntegrationManager.
This prevents zsh from interpreting the ! character as a history expansion character.

Problem

When commands contain ! (like in --collectCoverageFrom="!services/refactor-code/**/*.test.ts"),
zsh interprets it as history expansion and the command fails with "event not found" error,
causing Kilo Code to get stuck in a "waiting" state.

Solution

The fix adds setopt NO_BANG_HIST to the temporary .zshrc file created by
ShellIntegrationManager. This disables history expansion for non-interactive shells,
which is the desired behavior for programmatic command execution.

This is similar to how we already handle other zsh-specific issues like PROMPT_EOL_MARK
for special characters in output.

Testing

All existing tests pass (7386 passed, 87 skipped).

🤖 Generated with Claude Code

@changeset-bot
Copy link

changeset-bot bot commented Jan 10, 2026

🦋 Changeset detected

Latest commit: d7aac84

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kevinvandijk
Copy link
Collaborator

kevinvandijk commented Jan 14, 2026

Thank you! Looks good to me! I'll test it locally

Yurii Chukhlib and others added 2 commits January 17, 2026 12:23
…iling

Fixes Kilo-Org#807

Added `setopt NO_BANG_HIST` to the zsh initialization in ShellIntegrationManager.
This prevents zsh from interpreting the `!` character as a history expansion
character, which causes commands like `--collectCoverageFrom="!pattern"` to fail
with "event not found" error.

This is similar to how we already handle other zsh-specific issues like
PROMPT_EOL_MARK for special characters in output.

Co-Authored-By: Claude <[email protected]>
@YuriNachos YuriNachos force-pushed the fix/zsh-history-expansion-807 branch from c58f3e8 to 079dffd Compare January 17, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zsh ! history expansion command failures cause Kilo terminal to get stuck waiting

3 participants