Skip to main content
The Window API (vscode.window) provides access to VS Code’s UI, including editors, terminals, status bar, notifications, and user input dialogs. It’s one of the most frequently used namespaces in extension development.

Overview

The window namespace enables extensions to:
  • Show messages and dialogs to users
  • Create and manage webview panels
  • Access active editors and terminals
  • Display progress indicators
  • Create custom UI components (quick picks, input boxes)
  • Manage output channels and status bar items

Active Editors

Access Active Editor

Editor Properties

The currently focused text editor or undefined if none is active.
Array of all visible text editors.
The currently focused notebook editor or undefined.
The currently focused terminal or undefined.

Editor Events

Monitor editor changes with these events:

Showing Documents

Open Text Documents

Open at Specific Location

User Messages

Information Messages

Warning and Error Messages

Quick Pick

Simple Quick Pick

Quick Pick with Custom Items

Advanced Quick Pick

Input Box

Simple Input

Password Input

Custom Input Box

Terminals

Create Terminal

Terminal Events

Access All Terminals

Output Channels

Create Output Channel

Log Output Channel

Status Bar

Create Status Bar Item

Status Bar with Progress

Progress Indicators

Window Progress

Notification Progress

File Dialogs

Open File Dialog

Save File Dialog

Select Folder Dialog

Workspace Folder Picker

Window State

Monitor Window State

Tab Groups

Access Tab Groups

Tab Group Events

Best Practices

Choose the right message type for the situation. Reserve error messages for actual errors, not warnings or info.
Include relevant context in messages to help users understand what happened.
Show progress for any operation that takes more than a second.
Always dispose of status bar items, output channels, and terminals when they’re no longer needed.
Always validate input from showInputBox to ensure data quality.

Text Editor API

Work with text editors and documents

Workspace API

Access workspace files and folders

Commands API

Register and execute commands

Webview API

Create custom UI panels