aws / aws/amazon-q-developer-cli

Bug: TUI leaves focus reporting (ANSI ?1004h) enabled after exit, causing iTerm2 repeated warning on every new shell. Environment: kiro-cli 2.6.1, macOS ARM64, iTerm2 3.6.11, zsh. The tui.js component enables focus/mouse reporting but does not reliably dis

Open
#3,838 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 26.5.1 (25F80)

### Expected behaviour

When kiro-cli chat session exits or shell integration hooks run, all terminal modes enabled by kiro-cli (including focus reporting \e[?1004h) should be properly disabled (\e[?1004l). New shell sessions should start with a clean terminal state.

### Actual behaviour

Focus reporting mode remains enabled after kiro-cli exits. iTerm2 3.6.x detects this orphaned terminal state and displays a warning banner on every new shell/tab: "Looks like focus reporting was left on when an ssh session ended unexpectedly or an app misbehaved. Turn it off?"

### Steps to reproduce

1. Install kiro-cli 2.6.1 with shell integration enabled (zshrc.pre.zsh / zshrc.post.zsh hooks active)
2. Use iTerm2 3.6.11 on macOS
3. Open a new terminal tab or window
4. Wait a few seconds — the focus reporting warning banner appears
5. Repeat: open another new tab — same warning appears again

### Environment

```yaml

[q-details]
version = "2.6.1"
hash = "979b991de95e75ddf2318f67c6d196532502cad9"
date = "2026-06-08T21:20:13.479938Z (2d ago)"
variant = "full"

[system-info]
os = "macOS 26.5.1 (25F80)"
chip = "Apple M3 Pro"
total-cores = 11
memory = "18.00 GB"

[environment]
cwd = "/Users/USER/Downloads/kc-base"
cli-path = "/Users/USER/Downloads/kc-base"
os = "Mac"
shell-path = "/bin/bash"
shell-version = "3.2.57"
terminal = "iTerm 2"
install-method = "unknown"

[env-vars]
PATH = "/Users/USER/.toolbox/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/4.0.0/bin:/Users/USER/bin:/Users/USER/.local/bin:/usr/local/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Users/USER/.toolbox/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/4.0.0/bin:/Users/USER/bin:/Users/USER/.local/bin:/Applications/iTerm.app/Contents/Resources/utilities"
QTERM_SESSION_ID = "6dabca2577bc487f832ba9e514ad4d99"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "2.6.1"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.googlecode.iterm2"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.