Ctrl-Z suspend during active work can leave shell unusable after resume over tsh/Slurm

Open 💬 2 comments Opened Jun 23, 2026 by mvillmow

Summary

When Codex is doing work and I press Ctrl+Z to suspend it, then resume it, the shell can be left in a broken state where I cannot submit any commands.

Environment

  • Local terminal: iTerm2 on macOS
  • Remote access: tsh into a Linux Slurm cluster
  • Workload context: Codex running active work on cluster/login nodes

Reproduction

  1. Open iTerm2 on macOS.
  2. Connect to a Linux Slurm cluster using tsh.
  3. Start Codex and let it begin active work.
  4. Press Ctrl+Z to suspend Codex.
  5. Bring Codex back with fg.
  6. Try to enter and submit shell commands.

Expected behavior

After resume, Codex and/or the shell should restore terminal state cleanly. The shell should accept and submit commands normally.

Actual behavior

After Codex comes back up, the shell does not work properly and commands cannot be submitted.

Notes

This looks like it may involve terminal mode or job-control state not being restored correctly after SIGTSTP/SIGCONT, especially through iTerm2 plus tsh on remote Linux machines.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗