Input broken in TUI when shell_snapshot is enabled (macOS Terminal.app)

Open 💬 10 comments Opened Jan 16, 2026 by kfiramar
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

### What version of Codex is running?

codex-cli 0.87.0 (regression since 0.81.0; 0.80.0 works)

### What subscription do you have?

codex business plan

### Which model were you using?

gpt-5.2-codex xhigh

### What platform is your computer?

Darwin 24.5.0 arm64 (Apple Silicon)

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

Terminal.app

### What issue are you seeing?

When shell_snapshot is enabled, the TUI input breaks: Enter and Backspace stop working, / command menu doesn’t respond, and I sometimes see raw escape sequences like ^[[O (especially after alt‑tab). The CLI
becomes unusable.

codex --disable shell_snapshot fixes it immediately.

### What steps can reproduce the bug?

  1. Enable shell_snapshot (TUI /experimental → “Shell snapshot” or set [features].shell_snapshot = true in ~/.codex/config.toml and restart).
  2. In Terminal.app, use a .zshrc that touches the TTY (example below).
  3. Run codex.
  4. Observe Enter/Backspace not working and raw escape sequences appearing.

Repro setup:

mkdir -p /tmp/codex-tty-repro
cat > /tmp/codex-tty-repro/.zshrc <<'EOF'
stty sane 2>/dev/null
EOF

ZDOTDIR=/tmp/codex-tty-repro codex

Workaround:

ZDOTDIR=/tmp/codex-tty-repro codex --disable shell_snapshot

### What is the expected behavior?

Normal TUI input works: Enter sends messages, Backspace deletes, / menu opens.

### Additional information

Regression starts at 0.81.0+. 0.80.0 is fine.
<img width="577" height="215" alt="Image" src="https://github.com/user-attachments/assets/58aa015b-2ad3-4109-ad7d-147130543cd0" />

View original on GitHub ↗

10 Comments

etraut-openai contributor · 6 months ago

We haven't received any other reports like this, so I suspect this is something specific to your machine or configuration. Can you think of anything unusual about your configuration?

Just to confirm, you've tried reverting to 0.80.0 and this eliminates the problem? This is an important clue, so I want to verify that you've done this.

kfiramar · 6 months ago

Yes, reverting fixes everything
Please let me know what to share about my machine configuration (running macbook pro M4 latest OS)

etraut-openai contributor · 6 months ago

Do you have any non-default terminal settings? Does it work if you try a different terminal emulator?

kfiramar · 6 months ago

Some info (asked codex 0.80.0 for it ;) )

OS: macOS 15.5 (24F74)
uname -a: Darwin 24.5.0 arm64 (Kernel 24.5.0, RELEASE_ARM64_T8132)
codex --version: codex-cli 0.81.0
which codex: /opt/homebrew/bin/codex
shell: /bin/zsh; zsh 5.9 (arm64-apple-darwin24.0)
Terminal.app: 2.14
TERM/TERM_PROGRAM: TERM=xterm-256color; TERM_PROGRAM=Apple_Terminal;
TERM_PROGRAM_VERSION=455.1
SecureKeyboardEntry (Terminal): 1 (enabled)
tmux/screen: TMUX=, STY= (not in use)
locale: LANG/LC_* all C.UTF-8
stty -a: speed 9600 baud; 24 rows; 80 columns; lflags: icanon isig iexten echo
echoe ...; iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ...; oflags: opost
onlcr ...; cflags: cread cs8 -parenb ...; erase=^?; intr=^C; kill=^U; eof=^D
infocmp $TERM: standard macOS /usr/share/terminfo/78/xterm-256color (full
output available on request)

etraut-openai contributor · 6 months ago

Since we don't have any repro and haven't received any other reports of this, you'll likely need to do some debugging and diagnosis on your own to figure out what's different about your system or configuration. You might want to use ChatGPT to help think of things to try. Let us know if you find any good clues.

kfiramar · 6 months ago

Okay, investigating

I find it so weird that it's not really widespread... Reverting (using "npm install -g @openai/codex@0.80.0") fixes it all (which ofc leads me to believe it's a pure code issue)

kfiramar · 6 months ago

Running on 0.87.0 with 'codex --disable shell_snapshot' fixes the issue (still investigating)

kfiramar · 6 months ago

@etraut-openai
Opened a detailed PR (#9388), you have there the repro to replicate it yourself

It definitely is an edge case - but this was introduced in 0.81.0 by #9150 and the #9388 is fixing it

etraut-openai contributor · 6 months ago

Thanks for the analysis and fix. Yes, shell_snapshot is an experimental feature that is still under active development.

etraut-openai contributor · 3 months ago

@kfiramar, are you still seeing this issue with the latest version of the CLI?