From 578911de0355c0f8947929609ebbdfa025cccdf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=80=E1=B4=8D=E1=B4=9B=E1=B4=8F=E1=B4=80=E1=B4=87?= =?UTF-8?q?=CA=80?= Date: Mon, 12 Jan 2026 12:35:32 +0800 Subject: [PATCH] terminal: Avoid overlapping IME marked text with terminal content (#46227) Closes #33157 |Before|After| |--|--| |CleanShot 2026-01-07 at 12 18 21@2x|CleanShot 2026-01-07 at 12 19
02@2x| Many other terminals seem to do it this way as well. |Ghostty|Windows Terminal| Visual Studio Code| |--|--|--| |CleanShot 2026-01-07 at 12 23 30@2x|c89e03d2d92869d5ec1b8a05ade84df0|CleanShot 2026-01-07 at 12 27
01@2x| Release Notes: - Fixed UI overlap between IME marked text and terminal content. --- crates/terminal_view/src/terminal_element.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/terminal_view/src/terminal_element.rs b/crates/terminal_view/src/terminal_element.rs index 0a21aecf1ae30039a746b9061551ca1761a6b90e..1f98c1e61d28d2fecff6d55d02ecf01440ec093c 100644 --- a/crates/terminal_view/src/terminal_element.rs +++ b/crates/terminal_view/src/terminal_element.rs @@ -1363,6 +1363,14 @@ impl Element for TerminalElement { }], None ); + + // Paint background to cover terminal text behind marked text + let ime_background_bounds = Bounds::new( + ime_position, + size(shaped_line.width, layout.dimensions.line_height), + ); + window.paint_quad(fill(ime_background_bounds, layout.background_color)); + shaped_line.paint( ime_position, layout.dimensions.line_height,