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

Respond to bg and fg color ansi queries #1358

Merged
merged 5 commits into from
Apr 28, 2022
Merged

Respond to bg and fg color ansi queries #1358

merged 5 commits into from
Apr 28, 2022

Conversation

imsnif
Copy link
Member

@imsnif imsnif commented Apr 28, 2022

This change adds support for OSC 10 and 11. These can be used by terminal panes (or apps running inside terminal panes) to query the terminal's foreground and background colors (the response is sent through STDIN).

To do this, we use these queries ourselves on startup and on SIGWINCH, parsing saving the response and sending it back when we in turn are queried.

To try it out:

echo -e "\033]10;?\033\\"
echo -e "\033]11;?\033\\"

@imsnif imsnif temporarily deployed to cachix April 28, 2022 13:36 Inactive
@imsnif imsnif temporarily deployed to cachix April 28, 2022 13:36 Inactive
@imsnif imsnif temporarily deployed to cachix April 28, 2022 13:54 Inactive
@imsnif imsnif temporarily deployed to cachix April 28, 2022 13:54 Inactive
@imsnif imsnif temporarily deployed to cachix April 28, 2022 14:02 Inactive
@imsnif imsnif temporarily deployed to cachix April 28, 2022 14:02 Inactive
@imsnif imsnif temporarily deployed to cachix April 28, 2022 14:57 Inactive
@imsnif imsnif temporarily deployed to cachix April 28, 2022 14:57 Inactive
@imsnif imsnif merged commit 0dc136e into main Apr 28, 2022
@har7an har7an deleted the bg-and-fg-color-ansi branch October 23, 2022 15:11
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.

1 participant