google-gemini / google-gemini/gemini-cli

[Bug] Interactive TUI elements (Permissions, Slash commands) leave ghost visual artifacts and break scroll/rendering in iTerm2

Open
#27,374 5 comments 0 reactions 0 assignees View on GitHub
area/core effort/large kind/bug priority/p2 Stale status/bot-triaged
Dominant language
TypeScript
Stars
107k
Forks
14.6k
Avg merge
2d 3h
Merged PRs (30d)
45

Description

### Environment
- **CLI Tool:** `agy` (Antigravity CLI)
- **Version:** `1.0.1`
- **OS:** macOS 15.7 (Sequoia)
- **Terminal Emulator:** iTerm2
- **Shell:** `zsh`
- **Terminal size:** Typically ~80 columns x 24 lines (reproducible across various sizes)

---

### Description of the Bug
There are severe Terminal User Interface (TUI) rendering and redraw issues in `agy` version `1.0.1` that make interactive sessions extremely difficult and confusing to use. These rendering glitches occur across three primary scenarios:

#### Scenario 1: Permission Prompt Buttons Don't Clear (Ghost Buttons)
When the agent prompts for tool execution permissions (e.g., displaying `[Yes] [No] [For this session] [Always]`), making a selection and pressing Enter commits the action but **fails to erase or clean up the choice buttons from the terminal screen**.
- **The Glitch:** The interactive menu buttons remain drawn permanently in the terminal buffer.
- **The Impact:** The user is left unsure of the agent's current state. Even worse, if the user scrolls or tries to use keyboard arrows (Up/Down) afterwards, the text overlaps with the stale menu drawings, showing duplicated text chunks and breaking command line cursor movements.

#### Scenario 2: Slash Command Overlay GUI Does Not Exit Gracefully
When executing a slash command that displays an interactive layout (such as `/usage` or `/help` visual overlay screen), exiting the layout by pressing `Esc` closes the command loop, but **does not clear the interactive overlay graphics from the screen buffer**. The layout persists as a static "ghost drawing," cluttering the active terminal prompt area.

#### Scenario 3: `Ctrl + L` Wipes Chat History, Requiring Window Resize to Redraw
To clear the cluttered/stale screen buffer, users naturally attempt to use `Ctrl + L` (clear screen).
- **The Glitch:** Pressing `Ctrl + L` completely wipes out the entire visible active chat history, leaving a blank canvas.
- **The Workaround:** The only way to force `agy` to redraw the conversation history and bring back the interface text is by manually resizing (maximizing/minimizing or dragging to resize) the iTerm2 window.

---

### Steps to Reproduce
1. Start an interactive session: `agy -i`
2. Trigger any tool command that requests permissions. Select `Yes` (or another option) and press `Enter`. Observe that the options box is never cleared from the screen.
3. Type a slash command that draws a fullscreen or overlay screen (e.g. `/usage`). Press `Esc` to exit. Observe that the drawn overlay graphics remain printed on top of the active shell feed.
4. Try using Up/Down arrow keys or typing. Observe messy duplicate texts.
5. Press `Ctrl + L`. The chat disappears entirely. Resize the window to force it to redraw.

---

### Expected Behavior
1. Upon committing a choice (like tool permissions), the CLI should cleanly clear the ANSI lines of the prompt selection interface, leaving only the executed command or a clean state.
2. Exiting interactive slash command layouts (`Esc`) should cleanly restore the previous terminal screen buffer or completely wipe the overlay drawing.
3. `Ctrl + L` should trigger a full refresh/redraw of the active chat interface in the terminal buffer instead of wiping the history blank, or at least respect the shell's default scrollback behavior without breaking the TUI.

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.