In `screen` it repeated beats while thinking

Open 💬 3 comments Opened Apr 30, 2026 by Joshuaalbert
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.125.0

What subscription do you have?

pro

Which model were you using?

5.5

What platform is your computer?

Linux 6.8.0-87-generic

What terminal emulator and version are you using (if applicable)?

terminal

What issue are you seeing?

While programming in a screen which is super useful, it beeps while thinking.

What steps can reproduce the bug?

  1. screen
  2. codex
  3. turn on speakers
  4. enter any prompt
  5. listen to it beep

What is the expected behavior?

no beeping

Additional information

_No response_

View original on GitHub ↗

3 Comments

bwann · 3 months ago

I've noticed this too on iTerm+screen+codex. Capturing terminal output when it's drawing the screen I see this over and over "^[]2;4 wannnet^G^H^". Unsure if this is codex trying to update the terminal window name, but the ^G in there may be what's causing the repeated beeping.

etraut-openai contributor · 3 months ago

Based on the symptoms you're describing, it sounds like screen is probably mishandling or leaking the BEL-terminated OSC title-update sequence. Codex uses OSC 0 for title updates. You can use the /title command to disable the "Thinking" animation in the title.

rhsCZ · 3 months ago

I can reproduce this as well, and I did some additional debugging.

Environment:

  • Codex CLI running inside GNU screen
  • Terminal emulator: Windows Terminal
  • Remote Linux host over SSH
  • Windows Terminal bell is intentionally enabled, because I still want normal terminal bell behavior outside this case
  • GNU screen visual bell is enabled and works for plain BEL

What I verified:

  • Inside screen, printf '\a' does not produce an audible beep when screen visual bell is enabled, so screen is handling plain BEL correctly.
  • Codex still causes repeated audible beeps while it is working/thinking inside screen.
  • suppressApplicationTitle: true is already set in the Windows Terminal profile.
  • These manual OSC title tests do not beep:
  • printf '\033]0;⠼ test\a'
  • printf '\033]0;⠼ test\033\\'
  • Repeated animated title spam also does not beep by itself:
  • perl -e 'binmode STDOUT,":utf8"; for $c (qw/⠼ ⠦ ⠧ ⠇ ⠏ ⠋ ⠙ ⠹ ⠸ ⠴/) { for (1..100) { print "\e]0;$c test\a"; select undef,undef,undef,0.01 } }'
  • same test with \e\\ as the OSC terminator also does not beep.
  • These did not help:
  • env WT_SESSION= WT_PROFILE_ID= TERM=screen-256color codex
  • TERM=screen-256color-noprobes codex
  • I also tried removing u6/u7/u8/u9 from terminfo, but Codex still beeped.

Captured output:
I captured Codex output with:

script -qfec 'codex' /tmp/codex.typescript

The capture contained a very large number of terminal escape sequences:

  • BEL count: 7365
  • OSC count: 7367
  • CSI count: 830005
  • DCS count: 0
  • PM count: 0
  • APC count: 0

The most frequent CSI sequences were normal TUI redraw/control sequences such as:

  • ESC[49m
  • ESC[0m
  • ESC[K
  • ESC[39m
  • ESC[?2026h
  • ESC[?2026l
  • ESC[?25h
  • cursor movement sequences like ESC[28;3H, ESC[29;2H, etc.

The capture also contains many animated title updates like:

  • ESC]0;⠹ WSL2-Linux-KernelBEL
  • ESC]0;⠴ WSL2-Linux-KernelBEL
  • ESC]0;⠧ WSL2-Linux-KernelBEL

However, testing those OSC title sequences manually does not reproduce the beep in my environment.

I then filtered/replayed the captured output with cat:

This still beeped:

  • original /tmp/codex.typescript
  • variants where I removed only OSC/title sequences, only BEL/probe-related sequences, or only synchronized-output sequences

This did not beep:

  • removing all OSC + CSI escape sequences
  • keeping only SGR/style sequences
  • keeping only cursor movement sequences
  • keeping only erase/scroll sequences
  • removing OSC, private modes, terminal probes and keyboard-protocol related sequences together

Examples of non-beeping filtered variants:

perl -0777 -pe 's/\e\][^\x07]*(?:\x07|\e\\)//g;s/\e\[(?![0-9;]*m)[0-?]*[ -\/]*[@-~]//g' /tmp/codex.typescript > /tmp/codex.only-sgr.typescript && cat /tmp/codex.only-sgr.typescript

perl -0777 -pe 's/\e\][^\x07]*(?:\x07|\e\\)//g;s/\e\[(?![0-9;]*[HfGd])[0-?]*[ -\/]*[@-~]//g' /tmp/codex.typescript > /tmp/codex.only-cursor.typescript && cat /tmp/codex.only-cursor.typescript

perl -0777 -pe 's/\e\][^\x07]*(?:\x07|\e\\)//g;s/\e\[(?![0-9;]*[KJSM])[0-?]*[ -\/]*[@-~]//g' /tmp/codex.typescript > /tmp/codex.only-erase-scroll.typescript && cat /tmp/codex.only-erase-scroll.typescript

perl -0777 -pe 's/\e\][^\x07]*(?:\x07|\e\\)//g;s/\e\[\?[0-9;]*[hl]//g;s/\e\[6n//g;s/\e\[c//g;s/\e\[\?u//g;s/\e\[>[0-9;]*[mu]//g' /tmp/codex.typescript > /tmp/codex.workaround1.typescript && cat /tmp/codex.workaround1.typescript

So at this point it does not look like a simple plain BEL issue, nor only an animated terminal-title issue. It seems to be triggered by Codex TUI redraw/control behavior interacting badly with GNU screen + Windows Terminal.

Expected behavior:
Codex should not repeatedly trigger audible terminal beeps while working inside GNU screen. Plain terminal bell behavior should remain controlled by the terminal/screen configuration.

Actual behavior:
Codex repeatedly causes audible beeps while thinking/working inside GNU screen.

Suggested fix:
Please consider adding a config option to disable terminal probing / terminal title updates / advanced TUI terminal control sequences more aggressively, or use a more conservative fallback when running under TERM=screen*. It may also be useful to avoid repeatedly enabling/disabling advanced terminal modes in this environment.

Workaround:
Workaround from #16332 seems working.
Setting in .codex/config.toml this and it stopped beeping for me.
``
[tui]
terminal_title = []
``