mirror of
https://github.com/Textualize/rich.git
synced 2025-12-23 07:08:35 +00:00
No windows legacy terminal support when no ctypes
This commit is contained in:
parent
f82a399d58
commit
6364fdfbca
3 changed files with 11 additions and 0 deletions
|
|
@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
### Changed
|
||||
|
||||
- Don't use windows legacy terminal support when ctypes is not available.
|
||||
|
||||
## [14.2.0] - 2025-10-09
|
||||
|
||||
### Changed
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ The following people have contributed to the development of Rich:
|
|||
- [Ed Davis](https://github.com/davised)
|
||||
- [Pete Davison](https://github.com/pd93)
|
||||
- [James Estevez](https://github.com/jstvz)
|
||||
- [Jeong, YunWon](https://github.com/youknowone)
|
||||
- [Jonathan Eunice](https://github.com/jonathan-3play)
|
||||
- [Aryaz Eghbali](https://github.com/AryazE)
|
||||
- [Oleksis Fraga](https://github.com/oleksis)
|
||||
|
|
|
|||
|
|
@ -581,6 +581,12 @@ def get_windows_console_features() -> "WindowsConsoleFeatures": # pragma: no co
|
|||
|
||||
def detect_legacy_windows() -> bool:
|
||||
"""Detect legacy Windows."""
|
||||
try:
|
||||
import ctypes # noqa: F401
|
||||
except ImportError:
|
||||
# No ctypes doesn't mean no legacy windows,
|
||||
# but legacy windows mode requires ctypes, so we force it off.
|
||||
return False
|
||||
return WINDOWS and not get_windows_console_features().vt
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue