Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually run OSC11 query #23870

Closed
Baspar opened this issue Jun 1, 2023 · 4 comments
Closed

Manually run OSC11 query #23870

Baspar opened this issue Jun 1, 2023 · 4 comments
Labels
enhancement feature request events events, autocommands tui
Milestone

Comments

@Baspar
Copy link

Baspar commented Jun 1, 2023

Problem

background is currently determined at neovim start time, using a OSC11? query.
When changing background color/theme, it would be helpful to have a way to tell neovim to re-query the terminal for a background color.

Vim has a way to do so by executing :call echoraw(&t_RB) (Effectively printing the OSC11? query to the TTY)

Expected behavior

Have a way to re-evaluate the background using OSC11?

@Baspar Baspar added the enhancement feature request label Jun 1, 2023
@zeertzjq
Copy link
Member

zeertzjq commented Jun 1, 2023

Does this work?

:call chansend(v:stderr, "\x1b]11;?\x07")

@Baspar
Copy link
Author

Baspar commented Jun 1, 2023

Nope, it keeps the background value unchanged

@gpanders
Copy link
Member

gpanders commented Jun 1, 2023

Nope, it keeps the background value unchanged

IIRC the OSC 11 response is only parsed on startup, so if the response is received later it will not update 'background' automatically.

You would have to parse the response from the terminal yourself, or maybe we could update the code in input.c to always handle the OSC 11 response.

Or option 3 is to introduce a higher level abstraction (a function/option/autocommand) that handles the whole process of issuing OSC 11 -> reading the response -> updating 'background' that could be triggered by a user at any time.

@zeertzjq zeertzjq added the tui label Sep 16, 2023
@justinmk
Copy link
Member

Or option 3 is to introduce a higher level abstraction (a function/option/autocommand) that handles the whole process of issuing OSC 11 -> reading the response -> updating 'background' that could be triggered by a user at any time.

TermResponse was implemented #25856

@justinmk justinmk added this to the 0.10 milestone Nov 16, 2023
@justinmk justinmk added the events events, autocommands label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request events events, autocommands tui
Projects
None yet
Development

No branches or pull requests

4 participants