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

DECRQSS +q5463;524742;73657472676266;73657472676262$qm appears in terminal #28776

Closed
lpar opened this issue May 16, 2024 · 8 comments · Fixed by #29197
Closed

DECRQSS +q5463;524742;73657472676266;73657472676262$qm appears in terminal #28776

lpar opened this issue May 16, 2024 · 8 comments · Fixed by #29197
Labels
bug issues reporting wrong behavior platform:macos tui
Milestone

Comments

@lpar
Copy link

lpar commented May 16, 2024

Problem

When I start nvim 0.10.0 I see +q5463;524742;73657472676266;73657472676262$qm appear at the top left of the terminal window, with the $qm in italic and darker. After a fraction of a second it disappears and the regular initial window contents appear.

Using a terminal to a remote Mac, I see p$qm+q5463;524742;73657472676266;73657472676262$qm+q4D73 with the $qm+q4D73 in dark italic.

I didn't see this with 0.9.5.

It still does it with nvim --clean.

I'm guessing this is due to DECRQSS terminal escapes that aren't implemented by macOS terminal. Apparently they aren't implemented for alacritty either.

Steps to reproduce

nvim --clean

Expected behavior

Initial NVIM v0.10.0 blank window appears.

Neovim version (nvim -v)

NVIM v0.10.0

Vim (not Nvim) behaves the same?

no, 9.0.2142

Operating system/version

macOS 14.5

Terminal name/version

macOS terminal

$TERM environment variable

xterm-256color

Installation

Homebrew

@lpar lpar added the bug issues reporting wrong behavior label May 16, 2024
@wookayin wookayin modified the milestone: 0.10.1 May 16, 2024
@justinmk
Copy link
Member

I'm certain this is discussed in existing, closed issues.

@clason
Copy link
Member

clason commented May 16, 2024

Don't use Apple Terminal, it's plain broken. iTerm2 (3.5, the betas are release candidates now) will do in a pinch.

@gpanders
Copy link
Member

gpanders commented May 16, 2024

I'm guessing this is due to DECRQSS terminal escapes that aren't implemented by macOS terminal. Apparently alacritty/alacritty#7184.

The terminal should not print an escape sequence just because it's unimplemented. This is just Apple Terminal being terrible, as usual.

We disabled DECRQSS for Apple Terminal in #28453, but that won't work for a remote SSH session (the remote session doesn't know anything about the terminal emulator). We are also sendin XTGETTCAP and DECRQSS requests to determine truecolor support in _defaults.lua, where we don't have any guards for Apple Terminal.

A workaround in the meantime is to set COLORTERM=truecolor in your remote environment and also use set notermguicolors in your init file. Setting $COLORTERM this way will prevent Nvim from querying the terminal (it will assume that the terminal does support truecolor), and then disabling 'termguicolors' in your init file will disable it again.

@zgpio
Copy link

zgpio commented May 17, 2024

Same issue on windows cmd.exe
use nvim --clean to reproduce.

@tronboto
Copy link

tronboto commented Jun 4, 2024

I'm also seeing this on PuTTY 0.81

@gpanders
Copy link
Member

gpanders commented Jun 4, 2024

If #29197 is applied then you can opt out of the DECRQSS/XTGETTCAP queries by setting $COLORTERM to any value other than truecolor or 24bit (e.g. 256 or 16).

@tronboto
Copy link

tronboto commented Jun 7, 2024

Thanks for that PR, @gpanders . I see the PR mentions that setting $COLORTERM to truecolor or 24bit should prevent the terminal from being queried. However, I've found that when setting that, I no longer see $qm463;524742;73657472676266;73657472676262, which is great, but I still see +q4D73 pop up briefly. This is on PuTTY 0.81.

@gpanders
Copy link
Member

gpanders commented Jun 7, 2024

Thanks for that PR, @gpanders . I see the PR mentions that setting $COLORTERM to truecolor or 24bit should prevent the terminal from being queried. However, I've found that when setting that, I no longer see $qm463;524742;73657472676266;73657472676262, which is great, but I still see +q4D73 pop up briefly. This is on PuTTY 0.81.

That is the OSC 52 query. Set vim.g.clipboard = false in your init.lua to disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior platform:macos tui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants