Skip to content

Conversation

@sstoops
Copy link

@sstoops sstoops commented Nov 19, 2024

Recent Textual updates have rendered textual-terminal unusable. The issue exists when accessing the DEFAULT_COLORS variable that no longer exists. This updates the color detection to use Textual's built in theme management.

@YoonSungHyun-Git
Copy link

Hello, when will it be released?

@tleonhardt
Copy link

@mitosch Would it be possible to get this PR merged in an a new release of textual-terminal to PyPI? I'd like to be able to experiment using this with a current version of Textual.

@aiden-leong
Copy link

pip install git+https://github.com/sstoops/textual-terminal.git@patch-1

SameeranB added a commit to SameeranB/textual-terminal that referenced this pull request Aug 14, 2025
Fixes mitosch#12

This commit resolves the compatibility issues with Textual v5.3.0+ by:

1. **Remove deprecated imports**:
   - Removed `from textual.app import DEFAULT_COLORS`
   - Removed `from textual.design import ColorSystem`

2. **Update detect_textual_colors() method**:
   - Replace deprecated `self.app.dark` with modern theme detection
   - Use string-based theme checking: `"dark" in str(self.app.theme).lower()`
   - Return static color dictionary instead of using ColorSystem.generate()

3. **Version and dependency updates**:
   - Bump version to 0.4.0
   - Update Textual dependency to support >=0.8.0,<6.0.0
   - Update README to mention v5.3.0+ compatibility

This provides a more robust solution than PR mitosch#11 by completely removing
deprecated APIs rather than working around them. The fix has been tested
with Textual v5.3.0 and maintains backward compatibility with older versions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants