Feature Request: Add ability to detect when running in terminal #3475

Closed
opened 2026-01-30 23:22:12 +00:00 by claunia · 1 comment
Owner

Originally created by @avylove on GitHub (Aug 18, 2019).

Description of the new feature/enhancement

There doesn't seem to be an obvious way to detect when running from the terminal. This is a issue for applications and libraries where behavior is dependent on the terminal. For example, a Python library may require colorama for some terminals and not others.

Proposed technical implementation details

The most common and portable way to do this is to set the TERM environment variable when initializing the terminal.

Originally created by @avylove on GitHub (Aug 18, 2019). # Description of the new feature/enhancement There doesn't seem to be an obvious way to detect when running from the terminal. This is a issue for applications and libraries where behavior is dependent on the terminal. For example, a Python library may require colorama for some terminals and not others. # Proposed technical implementation details The most common and portable way to do this is to set the TERM environment variable when initializing the terminal.
claunia added the Issue-FeatureNeeds-TriageResolution-Duplicate labels 2026-01-30 23:22:12 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 18, 2019):

Duplicate: #1040, but honestly, Windows Terminal is built with the same support for VT sequences as conhost, which attempts to be as close to xterm-256color as we can get it. Practically, that means that Python library should just use colorama, because it'll work properly on most recent versions of Windows 10 with and without Terminal installed.

@DHowett-MSFT commented on GitHub (Aug 18, 2019): Duplicate: #1040, but honestly, Windows Terminal is built with the same support for VT sequences as conhost, which attempts to be as close to xterm-256color as we can get it. Practically, that means that Python library should _just use colorama_, because it'll work properly on most recent versions of Windows 10 with **and without** Terminal installed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3475