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

fix(terminal): preserve $COLORTERM value from outer terminal #24760

Closed
wants to merge 1 commit into from

Conversation

gpanders
Copy link
Member

@gpanders gpanders commented Aug 17, 2023

If the outer terminal claims to support truecolor through the $COLORTERM environment variable, then it should not be modified by Nvim just because 'termguicolors' is unset.

If an application running in :terminal writes a direct color sequence (i.e. CSI 38 ; 2 ; <r> ; <g> ; <b> m) that sequence is forwarded directly to the outer terminal emulator, where it is displayed in truecolor if the terminal supports it, regardless of the value of 'termguicolors'. The only affect that 'termguicolors' has on colors for applications in :terminal is how the 16 ANSI colors are displayed (when 'termguicolors' is set, the ANSI colors are set with g:terminal_color_x; otherwise, they are forwarded directly to the outer terminal).

^ This is all wrong. Ignore this.

If the outer terminal claims to support truecolor through the $COLORTERM
environment variable, then it should not be modified by Nvim just
because 'termguicolors' is unset.

If an application running in :terminal writes a direct color sequence
(i.e. CSI 38 ; 2 ; <r> ; <g> ; <b> m) that sequence is forwarded
directly to the outer terminal emulator, where it is displayed in
truecolor if the terminal supports it, regardless of the value of
'termguicolors'. The only affect that 'termguicolors' has on colors
for applications in :terminal is how the 16 ANSI colors are displayed
(when 'termguicolors' is set, the ANSI colors are set with
g:terminal_color_x; otherwise, they are forwarded directly to the outer
terminal).

Ref: neovim#13315

Fixes: neovim#24717
@github-actions github-actions bot added the terminal built-in :terminal or :shell label Aug 17, 2023
@gpanders gpanders marked this pull request as draft August 17, 2023 16:24
@gpanders

This comment was marked as outdated.

@gpanders gpanders closed this Aug 17, 2023
@gpanders gpanders deleted the keep-colorterm branch August 17, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terminal built-in :terminal or :shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant