Codex CLI TUI repeatedly hides and shows the text cursor in WezTerm while a turn is running
What version of Codex CLI is running?
codex-cli 0.144.1
What subscription do you have?
ChatGPT subscription via ChatGPT sign-in (pro)
Which model were you using?
gpt-5.6-sol
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
WezTerm 20240203-110809-5046fc22 Windows PowerShell, without tmux, screen, zellij, WSL, or another multiplexer TERM=xterm-256color
Codex doctor report
codex doctor --json did not complete. It timed out after more than 30 seconds without producing output.
What issue are you seeing?
While a Codex CLI turn is actively running, the text cursor in the prompt
input area repeatedly disappears and reappears. Visually, it looks like a
blinking cursor.
This occurs specifically in WezTerm. Running the same Codex CLI workflow in
other terminal emulators does not produce the visible cursor blinking.
The behavior is not caused by WezTerm's configured cursor blink animation. I
tested the following WezTerm settings and fully restarted all WezTerm
processes before starting a new Codex session:
config.default_cursor_style = "SteadyBlock"
config.cursor_blink_rate = 0
The issue remained unchanged.
I also tested the following Codex configuration:
[tui]
animations = false
This did not resolve the issue either.
To distinguish terminal cursor animation from application-controlled cursor
visibility, I polled the active WezTerm pane while a Codex turn was running:
wezterm cli list --format json
The pane state repeatedly alternated between Visible and Hidden while the
cursor coordinates remained unchanged:
visibility=Visible shape=Default x=2 y=22
visibility=Visible shape=Default x=2 y=22
visibility=Hidden shape=Default x=2 y=22
visibility=Visible shape=Default x=2 y=22
visibility=Hidden shape=Default x=2 y=22
visibility=Visible shape=Default x=2 y=22
visibility=Hidden shape=Default x=2 y=22
The transitions occur approximately every 300–500 ms while the turn is active.
This indicates that the terminal is receiving application-controlled cursor
visibility changes rather than merely animating a blinking cursor shape.
Typing also exposes the same relationship: when a character is entered, the
cursor disappears during the redraw and then reappears at the new position.
WezTerm's cursor_blink_rate setting cannot prevent this because it controls
only the terminal's own cursor animation, not application-issued cursor
visibility changes.
It appears that the Codex TUI/Ratatui rendering path temporarily hides the
cursor during redraws and leaves the Hidden state observable between frames in
WezTerm. Other tested terminals appear to coalesce or mask these intermediate
visibility changes.
What steps can reproduce the bug?
- Start WezTerm 20240203-110809-5046fc22 on Windows 11.
- Open Windows PowerShell directly, without WSL or a terminal multiplexer.
- Run Codex CLI with:
codex
- Enter any prompt that causes the agent to work for several seconds.
- While the status shows Working, observe the cursor in the prompt input
area.
- The cursor repeatedly disappears and reappears approximately every 300–500
ms.
- Enter one or more characters while the turn is still running.
- Observe that the cursor disappears during the redraw and then reappears at
the new position.
The visibility changes can also be verified from another PowerShell process by
repeatedly running:
1..40 | ForEach-Object {
$pane = wezterm cli list --format json |
ConvertFrom-Json |
Where-Object is_active
"visibility=$($pane.cursor_visibility) shape=$($pane.cursor_shape)
x=$($pane.cursor_x) y=$($pane.cursor_y)"
Start-Sleep -Milliseconds 100
}
The output alternates between cursor_visibility=Visible and
cursor_visibility=Hidden while x and y remain unchanged.
The issue remains reproducible after:
- Closing every WezTerm window.
- Confirming that wezterm-gui.exe is no longer running.
- Starting a completely new WezTerm process.
- Starting a new Codex CLI session.
- Setting cursor_blink_rate = 0 and default_cursor_style = "SteadyBlock".
- Setting [tui] animations = false.
What is the expected behavior?
The prompt cursor should remain steadily visible while a Codex turn is
running.
If the TUI needs to hide the cursor temporarily while drawing a frame, the
Hide, redraw, and Show operations should be contained within one synchronized
terminal update so that the intermediate Hidden state is never visibly
rendered.
The behavior should be consistent across WezTerm and other supported terminal
emulators.
Additional information
This does not appear to be a normal cursor-style preference or a WezTerm
blink-rate issue.
In the WezTerm source for this version, cursor animation is enabled only when
the effective cursor shape is a blinking shape and cursor_blink_rate is non-
zero. Despite setting cursor_blink_rate to zero, wezterm cli reports that the
pane's actual cursor_visibility state changes between Visible and Hidden.
I also tested increasing WezTerm's mux_output_parser_coalesce_delay_ms from
its default of 3 ms to 20 ms. This did not prevent the visibility transitions,
so they do not appear to be resolved by ordinary output coalescing.
There is no separate cursor-style or visibility option in the current Codex
TUI configuration that addresses this behavior.
A possible fix may be to ensure that the Codex/Ratatui draw path does not
leave the terminal cursor hidden between completed frames, or to ensure that
cursor restoration is included in the same synchronized output transaction as
the redraw.