Summary
kiro-cli init zsh pre unconditionally replaces the current zsh process with kiro-cli-term via exec in every interactive shell session. This causes several problems and there is no documented way to disable it.
Environment
- OS: macOS 15.5 (Darwin 25.4.0, Apple Silicon)
- Terminal: iTerm2 3.6.9
- Shell: zsh
- kiro-cli version: Installed via Kiro CLI.app (
/opt/homebrew/bin/kiro-cli)
- pyenv version: 2.6.23 (Homebrew)
How the shell integration works
-
kiro-cli installer adds hooks to ~/.zshrc:
# pre block
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.pre.zsh" ]] && builtin source "..."
# post block
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.post.zsh" ]] && builtin source "..."
-
The pre-init script runs eval "$(kiro-cli init zsh pre --rcfile zshrc)", which outputs:
Q_TERM_NAME="$(basename "${Q_SHELL}") (kiro-cli-term)"
exec -a "${Q_TERM_NAME}" "${Q_TERM_PATH}"
-
This exec replaces every interactive zsh process with kiro-cli-term, regardless of whether the user wants Kiro's inline completions or AI suggestions.
Problems
1. Killing kiro-cli-term closes iTerm2 tabs
Since exec replaces the shell process, kiro-cli-term is the tab's process. Running kill <pid> or pkill kiro-cli-term closes the entire iTerm2 tab (or all tabs if killing all instances). This is extremely confusing — users expect to be killing a Kiro background process, not their terminal session.
Process tree evidence:
iTermServer-3.6.9
└── login
└── zsh (kiro-cli-term) ← this IS the iTerm2 tab
2. Conflicts with pyenv rehash
Each shell startup triggers pyenv rehash (via eval "$(pyenv init -)"). When many shells start simultaneously (e.g., IDE launching multiple terminal tabs, CI tools, or terminal multiplexers), the kiro-cli-term exec adds overhead to shell startup, and pyenv's rehash lock contention causes:
pyenv: cannot rehash: couldn't acquire lock /Users/.../.pyenv/shims/.pyenv-shim for 60 seconds.
This happened 4 times before we traced it to the shell integration spawning additional shell init cycles.
3. No opt-out mechanism
There is no documented environment variable (e.g., KIRO_CLI_DISABLE_SHELL_INTEGRATION=1) or config option to disable the shell integration while keeping kiro-cli installed. The only workaround is manually commenting out the lines in ~/.zshrc, which may be overwritten on updates.
Expected behavior
- Provide an environment variable or config option to disable shell integration (e.g.,
KIRO_CLI_DISABLE_SHELL_INTEGRATION=1)
- Or: only wrap sessions when explicitly opted in, rather than wrapping all interactive shells unconditionally
- Document the opt-out mechanism in the CLI docs
Current workaround
Comment out all three Kiro shell integration lines in ~/.zshrc:
# [[ -f "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.pre.zsh" ]] && ...
# [[ "$TERM_PROGRAM" == "kiro" ]] && . "$(kiro --locate-shell-integration-path zsh)"
# [[ -f "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.post.zsh" ]] && ...
kiro-cli chat (non-interactive mode) continues to work perfectly without the shell integration.
Related issues
Summary
kiro-cli init zsh preunconditionally replaces the current zsh process withkiro-cli-termviaexecin every interactive shell session. This causes several problems and there is no documented way to disable it.Environment
/opt/homebrew/bin/kiro-cli)How the shell integration works
kiro-cliinstaller adds hooks to~/.zshrc:The pre-init script runs
eval "$(kiro-cli init zsh pre --rcfile zshrc)", which outputs:This
execreplaces every interactive zsh process withkiro-cli-term, regardless of whether the user wants Kiro's inline completions or AI suggestions.Problems
1. Killing
kiro-cli-termcloses iTerm2 tabsSince
execreplaces the shell process,kiro-cli-termis the tab's process. Runningkill <pid>orpkill kiro-cli-termcloses the entire iTerm2 tab (or all tabs if killing all instances). This is extremely confusing — users expect to be killing a Kiro background process, not their terminal session.Process tree evidence:
2. Conflicts with pyenv rehash
Each shell startup triggers
pyenv rehash(viaeval "$(pyenv init -)"). When many shells start simultaneously (e.g., IDE launching multiple terminal tabs, CI tools, or terminal multiplexers), thekiro-cli-termexec adds overhead to shell startup, and pyenv's rehash lock contention causes:This happened 4 times before we traced it to the shell integration spawning additional shell init cycles.
3. No opt-out mechanism
There is no documented environment variable (e.g.,
KIRO_CLI_DISABLE_SHELL_INTEGRATION=1) or config option to disable the shell integration while keepingkiro-cliinstalled. The only workaround is manually commenting out the lines in~/.zshrc, which may be overwritten on updates.Expected behavior
KIRO_CLI_DISABLE_SHELL_INTEGRATION=1)Current workaround
Comment out all three Kiro shell integration lines in
~/.zshrc:kiro-cli chat(non-interactive mode) continues to work perfectly without the shell integration.Related issues