aws / aws/amazon-q-developer-cli
bug: Amazon Q Corrupts Terminal Keybindings During Command Completion
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
### Description
I have tried every version of Amazon Q CLI since July 2024, and all of them have the same terminal behavior issue on macOS. When Amazon Q suggests completions for the flutter command, action keys like Enter, Backspace, and arrow keys stop working correctly.
Old Related Discussion: [GitHub Discussion #235](https://github.com/aws/q-command-line-discussions/discussions/235)
### 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 15.2.0 (24C101)
### Expected behaviour
The terminal should continue to accept input normally, without altering the behavior of all action keys such as arrow keys, Enter, and Backspace.
### Actual behaviour
After Amazon Q suggests completions for the flutter command, the terminal starts behaving incorrectly:
- Pressing Enter results in ^M being displayed.
- Pressing Backspace results in ^? being displayed.
- Other special characters may also appear in place of their intended actions.
### Steps to reproduce
1. Open a terminal on macOS with Amazon Q installed and enabled.
2. Type the command flutter run -d {device id} where {device id} is a valid Flutter device ID (such as chrome, macos, etc.).
3. As Amazon Q begins to provide command suggestions, the terminal input starts displaying unusual characters when pressing Enter or any other action key.
https://github.com/user-attachments/assets/0a4ca705-530f-4721-b802-5b0ba1dcfaf4
### Environment
```yaml
[q-details]
version = "1.6.0"
hash = "6d13844d6546a5c29e7e121450af1130eb189e7f"
date = "2025-01-09T00:47:39.704258Z (24d ago)"
variant = "full"
[system-info]
os = "macOS 15.2.0 (24C101)"
chip = "Apple M3 Pro"
total-cores = 12
memory = "36.00 GB"
[environment]
cwd = "/Users/USER"
cli-path = "/Users/USER"
os = "Mac"
shell-path = "/bin/zsh"
shell-version = "5.9"
terminal = "Ghostty"
install-method = "unknown"
[env-vars]
PATH = "/opt/homebrew/bin:/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:/opt/homebrew/bin:/usr/local/bin/python3:/Applications/Android Studio.app/Contents/MacOS:/Users/USER/Library/Android/sdk/emulator:/Users/USER/Library/Android/sdk/platform-tools:/Users/USER/Library/Android/sdk/cmdline-tools/latest/bin:/Users/USER/.puro/bin:/Users/USER/.puro/envs/default/flutter/bin:/Users/USER/.pub-cache/bin:/Users/USER/.local/bin"
QTERM_SESSION_ID = "32f4d64055ff4a8d945f75c8404cf606"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.6.0"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.mitchellh.ghostty"
```
Contributor guide
Assessment
This issue has not been assessed yet.