Windows: Open/attach background terminal session in a new Windows Terminal tab (PowerShell-friendly)
What feature would you like to see?
Summary
When Codex runs a long-lived/background terminal session, add a way to view/attach it in a separate terminal tab (or pane) in Windows Terminal so I can keep my main Codex chat flow in one tab while watching logs/output in another.
Problem / Motivation
Background terminal sessions are most useful when:
- I can keep working in the main Codex session
- while simultaneously watching build/test/dev-server logs
- without copy/pasting commands or losing context
Today, background execution is trending toward being possible (and there are active discussions/PRs about background job management),
but there’s no first-class “show this background session in another tab/pane” workflow for Windows users.
Related issues
- Background Terminal Sessions (#3968) — core capability request.
- Background task management / TUI (Ctrl+B) proposal (#6404)
- First-class background job management request (#7986)
Proposed solution
1) Introduce an “attach/view” command
Add a stable way to attach to a running background terminal session:
codex bg listcodex bg attach <session_id>(stream output + allow interaction if supported)codex bg logs <session_id> --follow(read-only mode is fine as a v1)
2) Windows Terminal integration: open in new tab/pane
Add a convenience flag that launches the viewer in a new Windows Terminal tab:
codex bg attach <id> --new-tab- (optional)
--split-panefor a side-by-side view
Implementation idea (Windows-only):
- Use
wtto open a new tab/pane targeting the current window (wt -w 0 new-tab .../split-pane ...) - Run
codex bg attach <id>(orcodex bg logs <id> --follow) inside that tab.
Windows Terminal supports scripted tab/pane creation via wt and commands like new-tab / split-pane.
3) UX/guardrails
- If Windows Terminal isn’t available, fall back to:
- printing a one-liner the user can run, or
- opening a new console window with the same command
- If interactive attach is hard, ship v1 as logs-only follow.
Acceptance criteria
- Can start background sessions and list them (id/name/status) using /ps more dynamically.
- Can attach or follow logs for a specific session
- On Windows Terminal:
--new-tabopens a new tab running the attach/log command - Clear docs + examples for PowerShell users
- Stays open but finishes with a prompt that asks permission before closing the tab.
Additional information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗