Skip to content

[codex] Add tmux-aware OSC 9 notifications#17836

Merged
caseychow-oai merged 1 commit intomainfrom
caseychow/codex/tmux-osc-9-dsc-support
Apr 21, 2026
Merged

[codex] Add tmux-aware OSC 9 notifications#17836
caseychow-oai merged 1 commit intomainfrom
caseychow/codex/tmux-osc-9-dsc-support

Conversation

@caseychow-oai
Copy link
Copy Markdown
Contributor

@caseychow-oai caseychow-oai commented Apr 14, 2026

Summary

  • wrap OSC 9 notifications in tmux's DCS passthrough so terminal notifications make it through tmux
  • use codex-terminal-detection for OSC 9 auto-selection so tmux sessions inherit the underlying client terminal support
  • add focused notification backend tests for plain OSC 9 and tmux-wrapped output

Stack

Why

Tmux does not forward OSC 9 notifications directly; the sequence has to be wrapped in tmux's DCS passthrough envelope. Codex also had local notification heuristics that could miss supported terminals when running under tmux, even though codex-terminal-detection already knows how to attribute tmux sessions to the client terminal.

Validation

  • just fmt
  • cargo test -p codex-tui (currently blocked by an unrelated existing compile error in app-server/src/message_processor.rs:754 referencing connection_id out of scope; not caused by this change)

@caseychow-oai caseychow-oai force-pushed the caseychow/codex/tmux-osc-9-dsc-support branch 3 times, most recently from a1f3a20 to 9938ca0 Compare April 15, 2026 21:27
@caseychow-oai caseychow-oai marked this pull request as ready for review April 15, 2026 21:28
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9938ca0a1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/notifications/osc9.rs Outdated
@caseychow-oai caseychow-oai force-pushed the caseychow/codex/tmux-osc-9-dsc-support branch 2 times, most recently from c7b17c0 to 97c0aea Compare April 17, 2026 20:52
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code overall looks good. The only thing is we might have a regression for WezTerm where I pointed it out. Can you add a test to check and fix it if found to be the case?

Comment thread codex-rs/tui/src/notifications/mod.rs
@fcoury-oai
Copy link
Copy Markdown
Contributor

fcoury-oai commented Apr 17, 2026

I also tested it with Ghostty and tmux and it worked even without the set -g allow-passthrough on and focus-events on. I just had to set focus elsewhere :-)

Comment thread codex-rs/tui/src/app.rs Outdated
@caseychow-oai caseychow-oai force-pushed the caseychow/codex/tmux-osc-9-dsc-support branch from bddbe55 to a9543e5 Compare April 18, 2026 13:20
@caseychow-oai caseychow-oai changed the base branch from main to caseychow/codex/tui-memory-settings-sqlite-home-straggler April 18, 2026 13:21
@fcoury-oai
Copy link
Copy Markdown
Contributor

Question: did you changes introduce the error you are fixing on the base PR?

The code looks good and I was able to replicate the behavior. I don't think you should submit this PR stacked on the other test fix. I would like to approve this PR with the test error and handle the other one separately. Would that be possible?

@caseychow-oai
Copy link
Copy Markdown
Contributor Author

Question: did you changes introduce the error you are fixing on the base PR?

The code looks good and I was able to replicate the behavior. I don't think you should submit this PR stacked on the other test fix. I would like to approve this PR with the test error and handle the other one separately. Would that be possible?

I'll restack and we can see!

@caseychow-oai caseychow-oai force-pushed the caseychow/codex/tmux-osc-9-dsc-support branch from a9543e5 to 2d0cf2f Compare April 20, 2026 18:48
@caseychow-oai caseychow-oai changed the base branch from caseychow/codex/tui-memory-settings-sqlite-home-straggler to main April 20, 2026 18:48
@caseychow-oai caseychow-oai force-pushed the caseychow/codex/tmux-osc-9-dsc-support branch from b42352c to 5dfc788 Compare April 20, 2026 19:25
@caseychow-oai
Copy link
Copy Markdown
Contributor Author

Question: did you changes introduce the error you are fixing on the base PR?

The code looks good and I was able to replicate the behavior. I don't think you should submit this PR stacked on the other test fix. I would like to approve this PR with the test error and handle the other one separately. Would that be possible?

@fcoury-oai looks like this is all green now.

Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, can't wait for this to land on an alpha version.

Code looks good, tested and still works.

@caseychow-oai caseychow-oai enabled auto-merge (squash) April 20, 2026 19:43
@caseychow-oai caseychow-oai force-pushed the caseychow/codex/tmux-osc-9-dsc-support branch from 5dfc788 to 8a45c89 Compare April 20, 2026 20:59
Co-authored-by: Codex <noreply@openai.com>
@caseychow-oai caseychow-oai force-pushed the caseychow/codex/tmux-osc-9-dsc-support branch from 4b4d9b3 to dc3936d Compare April 21, 2026 16:44
@caseychow-oai caseychow-oai merged commit 4165266 into main Apr 21, 2026
25 checks passed
@caseychow-oai caseychow-oai deleted the caseychow/codex/tmux-osc-9-dsc-support branch April 21, 2026 17:10
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2026
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.

2 participants