query_terminal: Add support for reporting name of the OS the terminal emulator is running on

Fixes #8201
This commit is contained in:
Kovid Goyal
2025-01-07 08:21:53 +05:30
parent a3d6bf7a2c
commit 69aead6d3d
3 changed files with 16 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ from typing import (
Iterable,
Iterator,
List,
Literal,
NamedTuple,
Optional,
Sequence,
@@ -178,7 +179,7 @@ currently_parsing = CurrentlyParsing()
@run_once
def os_name() -> str:
def os_name() -> Literal['macos', 'bsd', 'linux', 'unknown']:
if is_macos:
return 'macos'
if 'bsd' in _plat: