From 56d7314672e455f51548f67b9c8fa24f0d7de03c Mon Sep 17 00:00:00 2001 From: syk17 Date: Fri, 5 Dec 2025 02:16:26 -0800 Subject: [PATCH] Fix Input cursor visibility when in ANSI mode --- CHANGELOG.md | 4 ++++ src/textual/widgets/_input.py | 3 ++- .../test_snapshots/test_ansi_command_palette.svg | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab6ce20e8a..ecebf65f01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added `Content.blank` https://github.com/Textualize/textual/pull/6264 +### Fixed + +- Fixed `Input` cursor color display in ANSI mode (`ansi_color=True`) https://github.com/Textualize/textual/issues/6234 + ## [6.7.1] - 2025-12-1 ### Fixed diff --git a/src/textual/widgets/_input.py b/src/textual/widgets/_input.py index 08af812d40..e8470ddfbb 100644 --- a/src/textual/widgets/_input.py +++ b/src/textual/widgets/_input.py @@ -218,7 +218,8 @@ class Input(ScrollView): background: ansi_default; color: ansi_default; &>.input--cursor { - text-style: reverse; + background: ansi_white; + color: ansi_black; } &>.input--placeholder, &>.input--suggestion { text-style: dim; diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_ansi_command_palette.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_ansi_command_palette.svg index 8023e54db4..1f719d7771 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots/test_ansi_command_palette.svg +++ b/tests/snapshot_tests/__snapshots__/test_snapshots/test_ansi_command_palette.svg @@ -41,7 +41,7 @@ .terminal-r7 { fill: #0a0f13 } .terminal-r8 { fill: #00ff00 } .terminal-r9 { fill: #000000 } -.terminal-r10 { fill: #8d8d8d } +.terminal-r10 { fill: #7b7e82 } .terminal-r11 { fill: #7e8486 } .terminal-r12 { fill: #e0e0e0;font-weight: bold } .terminal-r13 { fill: #9eafbd } @@ -131,7 +131,7 @@ - + RedMagentaRedMagentaRedMagentaRedMagentaRedMagentaRedMagentaRed MagentaRedMagentaRedMagentaRedMagentaRedMagentaRedMagentaRed