mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
Merge 5c29651932
into 9c9b011187
This commit is contained in:
commit
caa958e1b1
3 changed files with 17 additions and 1 deletions
|
@ -5,6 +5,11 @@ 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).
|
||||
|
||||
## Upcoming
|
||||
|
||||
### Changed
|
||||
|
||||
- Enabled color support in marimo notebooks. https://github.com/Textualize/rich/pull/3651
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ The following people have contributed to the development of Rich:
|
|||
<!-- Add your name below, sort alphabetically by surname. Link to GitHub profile / your home page. -->
|
||||
|
||||
- [Patrick Arminio](https://github.com/patrick91)
|
||||
- [banteg](https://github.com/banteg)
|
||||
- [Gregory Beauregard](https://github.com/GBeauregard/pyffstream)
|
||||
- [Artur Borecki](https://github.com/pufereq)
|
||||
- [Pedro Aaron](https://github.com/paaaron)
|
||||
|
|
|
@ -528,6 +528,16 @@ def _is_jupyter() -> bool: # pragma: no cover
|
|||
return False # Other type (?)
|
||||
|
||||
|
||||
def _is_marimo() -> bool: # pragma: no cover
|
||||
"""Check if we're running in a marimo notebook."""
|
||||
try:
|
||||
import marimo
|
||||
|
||||
return marimo.running_in_notebook() is True
|
||||
except (ImportError, AttributeError):
|
||||
return False
|
||||
|
||||
|
||||
COLOR_SYSTEMS = {
|
||||
"standard": ColorSystem.STANDARD,
|
||||
"256": ColorSystem.EIGHT_BIT,
|
||||
|
@ -794,7 +804,7 @@ class Console:
|
|||
|
||||
def _detect_color_system(self) -> Optional[ColorSystem]:
|
||||
"""Detect color system from env vars."""
|
||||
if self.is_jupyter:
|
||||
if self.is_jupyter or _is_marimo():
|
||||
return ColorSystem.TRUECOLOR
|
||||
if not self.is_terminal or self.is_dumb_terminal:
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue