#20727·terminal

Add an action to select a command together with its output

Author: osecondsCreated Sep 26, 2026Updated Sep 28, 2026
LabelsIssue-FeatureNeeds-TriageNeeds-Tag-Fix

Description of the new feature

Windows Terminal currently provides selectCommand and selectOutput as separate shell-integration actions.

I would like to bind a single shortcut that selects the previous command together with its output, so the complete command/result block can be copied at once.

I tried combining the existing actions with multipleActions:

json
{
    "action": "multipleActions",
    "actions": [
        {
            "action": "selectOutput",
            "direction": "prev"
        },
        {
            "action": "selectCommand",
            "direction": "prev"
        }
    ]
}

Both actions work individually, and multipleActions also runs correctly, but the second selection replaces the first one. In this example, the final selection contains only the command rather than the command and its output.

It would be useful to have an action that selects the command and its associated output as one region.

Environment:

  • Windows Terminal: 1.24.11911.0
  • Windows 10
  • PowerShell: 7.6.6
  • Shell integration enabled

Related discussions:

  • #11000
  • #13455
  • #4588

Proposed technical implementation details

Shell integration already tracks the command and output boundaries separately.

If appropriate, this could be exposed as another selection action alongside selectCommand and selectOutput, selecting from the start of the command through the end of its output.