Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fixed empty print ignoring the `end` parameter
- Fixed `Text.from_ansi` removing newlines https://github.com/Textualize/rich/pull/4076
- Fixed `FileProxy.isatty` not proxying https://github.com/Textualize/rich/pull/4077

## [14.3.4] - 2026-04-11

Expand Down
3 changes: 3 additions & 0 deletions rich/file_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ def flush(self) -> None:

def fileno(self) -> int:
return self.__file.fileno()

def isatty(self) -> bool:
return self.__file.isatty()
17 changes: 17 additions & 0 deletions tests/test_file_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,20 @@ def test_new_lines():
assert file.getvalue() == "-\n"
file_proxy.flush()
assert file.getvalue() == "-\n-\n"


def test_isatty():
"""Check isatty is proxied

Regression test for https://github.com/Textualize/rich/issues/4041

"""

class TTYFile:
def isatty(self) -> bool:
return True

file = TTYFile()
console = Console()
file_proxy = FileProxy(console, file)
assert file_proxy.isatty()
Loading