Skip to content

Screen not redrawn properly on t_RB response - #18149

Closed
julio-b wants to merge 1 commit into
vim:masterfrom
julio-b:reqbg
Closed

julio-b wants to merge 1 commit into
vim:masterfrom
julio-b:reqbg

Conversation

@julio-b

@julio-b julio-b commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Problem: screen not redrawn properly on t_RB response (after v9.1.1703)
Solution: call redraw_asap() if necessary

Steps to reproduce the bug:

  1. Terminal: kitty, os: Arch Linux, shell: bash
  2. $ cat reqbg.vim
let &t_RF = "\e]10;?\e\\"
let &t_RB = "\e]11;?\e\\"
colo lunaperche
  1. $ vim --clean +'runtime plugin/colorresp.vim' +'so reqbg.vim'

Result: bg=light is used initially, bg=dark is detected but the screen stays white. On user input the screen is redrawn with bg=dark.

2025-08-28_02-56_38.webm

Expected behavior: vim should use dark bg as soon as it is detected.

My first idea was to fix this with a simple :redraw command in colorresp.vim,

diff --git i/runtime/plugin/colorresp.vim w/runtime/plugin/colorresp.vim
index f597dc7eb..381609b5b 100644
--- i/runtime/plugin/colorresp.vim
+++ w/runtime/plugin/colorresp.vim
@@ -29,6 +29,7 @@ augroup ColorResp

         v:termrbgresp = v:termosc
         &background = new_bg_val
+        redraw
         # For backwards compatibility
         if exists('#TermResponseAll#background')
           doautocmd <nomodeline> TermResponseAll background

but if we do this then the intro message disappears immediately.
We have to call redraw_asap() which handles maybe_intro_message() correctly.

Problem:  screen not redrawn properly on t_RB response (after v9.1.1703)
Solution: call redraw_asap() if necessary
@chrisbra

Copy link
Copy Markdown
Member

thanks

@chrisbra chrisbra closed this in 99af769 Aug 29, 2025
sahinf pushed a commit to sahinf/vim that referenced this pull request Sep 7, 2025
Problem:  screen not redrawn properly on t_RB response (after v9.1.1703)
Solution: Call redraw_asap() if necessary (Julio B)

closes: vim#18149

Signed-off-by: Julio B <[email protected]>
Signed-off-by: Christian Brabandt <[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.

2 participants