Skip to content

Windows TUI: render common PowerShell actions as Read/Search/List instead of raw shell wrappers #18980

@xullul

Description

@xullul

What variant of Codex are you using?

Codex-CLI v0.122.0 on Windows

What feature would you like to see?

On Windows, Codex CLI often shows the full powershell.exe / pwsh wrapper as the main visible action in the TUI. For routine commands, that makes simple file reads and searches look much noisier than the same work on Linux/macOS.

I would like the TUI to show the intent of common PowerShell commands first:

Search "SomeClass" in src\App.cs

instead of leading with:

powershell.exe -NoProfile -Command "Get-Content .\src\App.cs | Select-String -Pattern 'SomeClass' -Context 0,20"

The raw command should still be preserved in details/history for auditing and reproduction. This request is about improving the primary action display, not hiding what was executed. This is a Windows-specific usability gap. PowerShell commands are naturally more verbose because they often include:

  • a shell wrapper such as powershell.exe -NoProfile -Command
  • heavier quoting
  • object/pipeline syntax
  • commands like Get-Content, Select-String, and Get-ChildItem
    When the TUI displays those wrappers as the main action, a basic search or file read can look more complex or risky than it is. That makes the activity feed harder to scan and makes Codex feel less polished on Windows.

Current behavior

For a command like:

powershell.exe -NoProfile -Command "Get-Content .\src\App.cs | Select-String -Pattern 'SomeClass' -Context 0,20"

the most visible TUI text may be the raw PowerShell invocation. That is exact, but it is not the best summary of what Codex is doing.

Requested behavior
For common non-mutating PowerShell commands, parse the wrapped command and render a concise semantic action in the TUI.

Example active state:

• Exploring
  └ Search "SomeClass" in src\App.cs

Example completed state (Exploring to Explored):

• Explored
  └ Search "SomeClass" in src\App.cs

The raw command should remain available in the command transcript/details:

Get-Content .\src\App.cs | Select-String -Pattern 'SomeClass' -Context 0,20

Commands that would be useful to recognize

These cover a lot of normal Windows agent activity:

Get-Content .\src\lib.rs
Get-Content .\src\app.rs | Select-Object -Skip 20 -First 40
Get-Content .\src\App.cs | Select-String -Pattern 'SomeClass' -Context 0,20
Select-String -Path .\src\App.cs -Pattern 'SomeClass' -Context 0,20
Get-ChildItem .\src

Suggested display mapping:

Get-Content <path>                               -> Read <path>
Get-Content <path> | Select-Object ...          -> Read <path>
Get-Content <path> | Select-String -Pattern <q> -> Search "<q>" in <path>
Select-String -Path <path> -Pattern <q>          -> Search "<q>" in <path>
Get-ChildItem <path>                             -> List <path>

Unknown or mutating commands can continue to fall back to the current raw-command display.

Related action display improvement

It would also help if command cells consistently used semantic action labels when Codex can infer them:

Read
Search
List
Editing / Edited
Testing / Tested
Building / Built
Linting / Linted
Checking git / Checked git
Waiting / Waited
Running / Ran

This keeps the activity feed scannable when Codex runs many small commands.

App-server command actions
If an app-server command execution already provides semantic command actions, the TUI should prefer those over the raw command string.

For example, if the command action says:

kind: search
query: SomeClass
path: src\App.cs

the command cell can render:

Search "SomeClass" in src\App.cs

while keeping the exact command in details/history.

Implementation shape
Possible low-risk approach:

  • unwrap powershell.exe / pwsh invocations before command display summarization
  • recognize only common read/list/search PowerShell patterns
  • keep unknown commands on the existing raw-command path
  • prefer existing semantic command actions from app-server when available
  • add TUI snapshot coverage showing both the semantic display and the preserved raw transcript
    This should improve Windows readability without changing command execution behavior.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or requestwindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions