Skip to content

Strip zsh -lc wrapper from TUI command headers - #5374

Merged
pakrym-oai merged 2 commits into
openai:mainfrom
hxreborn:fix/strip-zsh-lc-wrapper
Oct 20, 2025
Merged

pakrym-oai merged 2 commits into
openai:mainfrom
hxreborn:fix/strip-zsh-lc-wrapper

Conversation

@hxreborn

@hxreborn hxreborn commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor

Extends shell wrapper stripping in TUI to handle zsh -lc in addition to bash -lc.

Currently, Linux users (and macOS users with zsh profiles) see cluttered command headers like • Ran zsh -lc "echo hello" instead of • Ran echo hello. This happens because codex-rs/tui/src/exec_command.rs only checks for literal "bash", ignoring zsh and absolute paths like /usr/bin/zsh.

Changes:

  • Added is_login_shell_with_lc helper that extracts shell basename and matches against bash or zsh
  • Updated pattern matching to use the helper instead of hardcoded check
  • Added test coverage for zsh and absolute paths (/usr/bin/zsh, /bin/bash)

Testing:

cd codex-rs
cargo test strip_bash_lc_and_escape -p codex-tui

All 4 test cases pass (bash, zsh, and absolute paths for both).

Closes #4201

@github-actions

github-actions Bot commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@hxreborn

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 20, 2025
@hxreborn
hxreborn force-pushed the fix/strip-zsh-lc-wrapper branch from ab4ac08 to ec58606 Compare October 20, 2025 12:00
Extends shell wrapper stripping to handle zsh in addition to bash.
Supports absolute paths like /usr/bin/zsh and /bin/bash.

Closes openai#4201
@hxreborn
hxreborn force-pushed the fix/strip-zsh-lc-wrapper branch from ec58606 to 9808d9b Compare October 20, 2025 12:09
Update test expectation to match the new behavior where zsh -lc
wrapper is correctly stripped from command display.
@pakrym-oai pakrym-oai self-assigned this Oct 20, 2025
@pakrym-oai
pakrym-oai merged commit 0e8d937 into openai:main Oct 20, 2025
@pakrym-oai

Copy link
Copy Markdown
Contributor

Thank you!

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse more forms of apply_patch

2 participants