microsoft / microsoft/terminal

Feature Request: Add commands to query the state and metadata of tabs

Open
#19,818 4 comments 6 reactions 0 assignees View on GitHub
Area-Commandline Issue-Feature Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Description of the new feature

Currently, there's no way to programmatically query information about open terminal tabs, their profiles, and current working directories. This limits automation scenarios and makes it difficult to build tools that need to understand the terminal state.

### Current Limitations
- No command-line arguments to list current tabs (e.g., `--list-tabs`, `--query-state`, `--active-tab`)
- No way to get current working directory for each tab
- No way to identify which profile is active in each tab

### Use Cases
- terminal management tools
- automation scripts (scripts that need to interact with specific terminal tabs),
- monitoring tools,
- integration: coordinating tasks or interactions across multiple tabs/profiles etc.

This feature would bring Windows Terminal in line with other modern terminal emulators that provide automation interfaces (i.eTerm2, alacritty, etc.), enhancing the ecosystem.

### Proposed technical implementation details
Add a new API interface for querying terminal state with the following capabilities:
wt --list-tabs
wt --query-tabs --detailed
wt --query-tabs --window-id --detailed
wt --list-profiles

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by locating existing wt command-line argument handling and the terminal tab, profile, and working-directory state model. Done requires a defined querying interface covering the listed tab, window, profile, and detailed-state use cases, with tests for the supported commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.