neovim icon indicating copy to clipboard operation
neovim copied to clipboard

nvim detects wrong background in tmux

Open Bekaboo opened this issue 4 months ago • 4 comments

Problem

nvim uses light background when the terminal has dark background. This only happens in tmux (version 3.4).

Steps to reproduce

  1. nvim --clean in a dark terminal
  2. Notice that nvim uses light background

Expected behavior

nvim uses dark background.

Neovim version (nvim -v)

NVIM v0.10.0-dev-2503+gda2130934b

Vim (not Nvim) behaves the same?

no, vim does not automatically detects terminal background

Operating system/version

Linux 6.6.9-arch1-1

Terminal name/version

alacritty 0.13.1 (fe2a3c56)

$TERM environment variable

tmux-256color

Installation

AUR

Bekaboo avatar Mar 04 '24 01:03 Bekaboo

Cannot reproduce

zeertzjq avatar Mar 04 '24 01:03 zeertzjq

@zeertzjq Thanks for your response. I don't know how to reliably reproduce it on other machines but here's the screen recording on my end:

https://github.com/neovim/neovim/assets/76579810/ae1efa29-dd79-4002-a75f-29d3204eba18


I also noticed that

  1. This bug only happens when nvim is launched inside a tmux session
  2. This bug does not exist in version NVIM v0.10.0-dev-2363+gb76a01055f but exists in NVIM v0.10.0-dev-2503+gda2130934b

So I wonder if it is due to commit eef2aedff?

Bekaboo avatar Mar 05 '24 11:03 Bekaboo

@Bekaboo It's possible that your tmux configuration can be helpful here (or full repro with it).

przepompownia avatar Mar 07 '24 08:03 przepompownia

@przepompownia The problem persists but I cannot seem to reliably reproduce it, sometimes nvim detects the correct background but sometimes not. In addition, my tmux config is lengthy so I am not sure whether it will be helpful, but here is the link: https://github.com/Bekaboo/dot/blob/master/.config/tmux/tmux.conf

I will report here again once I have time to reduce my tmux config and find a way to reliably reproduce the bug.

Bekaboo avatar Mar 10 '24 14:03 Bekaboo