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

Black box on term buffer due to NvimTree #3068

Open
jugarpeupv opened this issue Feb 27, 2025 · 10 comments
Open

Black box on term buffer due to NvimTree #3068

jugarpeupv opened this issue Feb 27, 2025 · 10 comments
Labels
bug Something isn't working OS macOS specific to macOS

Comments

@jugarpeupv
Copy link

jugarpeupv commented Feb 27, 2025

Description

The problem is explained in this github discussion

neovim/neovim#32520

Neovim version

NVIM v0.11.0-dev-1861+g1e4c708033-Homebrew
Build type: Release
LuaJIT 2.1.1736781742
Run "nvim -V1 -v" for more info

Operating system and version

Macos arm

Windows variant

No response

nvim-tree version

6709463

Clean room replication

nvim -nu /tmp/nvim-tmp.lua

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {}
end

-- UNCOMMENT this block for diagnostics issues, substituting pattern and cmd as appropriate.
-- Requires diagnostics.enable = true in setup.
--[[
vim.api.nvim_create_autocmd("FileType", {
  pattern = "lua",
  callback = function()
    vim.lsp.start { cmd = { "lua-language-server" } }
  end,
})
]]

Steps to reproduce

nvim -nu

15sp|term
ls -la
<C-\><C-N> to get back to normal mode
<C-w>o

You will see the blackbox

Expected behavior

The black box is not rendered

Actual behavior

image image
@jugarpeupv jugarpeupv added the bug Something isn't working label Feb 27, 2025
@alex-courtis alex-courtis added OS Windows specific to windows and removed OS Windows specific to windows labels Feb 27, 2025
@alex-courtis
Copy link
Member

I cannot replicate this with kitty on linux however that is not surprising.

Unfortunately I don't have access to macos; could you give this a try @gegoune ?

FYI terminal return to normal default is <C-\><C-N> (I'm a terminal newbie)

@alex-courtis alex-courtis added the OS macOS specific to macOS label Feb 27, 2025
@alex-courtis
Copy link
Member

Does this occur with any other terminals @jugarpeupv ?

@jugarpeupv
Copy link
Author

jugarpeupv commented Feb 28, 2025

@alex-courtis Yes, this is iterm

Image

And this is alacritty

Image

And i also reproduced it with a minimal config

Image

Minimal config:

nvim -nu /tmp/nvim-tmp.lua

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {}
end

-- UNCOMMENT this block for diagnostics issues, substituting pattern and cmd as appropriate.
-- Requires diagnostics.enable = true in setup.
--[[
vim.api.nvim_create_autocmd("FileType", {
  pattern = "lua",
  callback = function()
    vim.lsp.start { cmd = { "lua-language-server" } }
  end,
})
]]

@gegoune
Copy link
Collaborator

gegoune commented Feb 28, 2025

Can't replicate with iterm2.

@jugarpeupv
Copy link
Author

Just reproduced it with nvim -nu /tmp/nvim-tmp.lua in iterm2

Image

@gegoune
Copy link
Collaborator

gegoune commented Feb 28, 2025

Must be something else in your configuration. Try without shell and terminal configurations.

@jugarpeupv
Copy link
Author

Okey i will try and let you know, thank you @gegoune

@jugarpeupv
Copy link
Author

jugarpeupv commented Feb 28, 2025

@gegoune i have tried using bash instead of zsh, removing all env variables, changing $TERM. But still reproducing it with iterm, kitty and alacritty

Only if i use default Terminal.app i do not reproduce it, with Terminal.app using my default zsh or bash config, it works well with both, with the minimal example i provided and with my neovim config

I have no idea what could be, what i have noticed is with Terminal.app if i open neovim with or without my personal config, the colors are missing, but i dont know why

Image

@gegoune
Copy link
Collaborator

gegoune commented Feb 28, 2025

Can you reproduce it without ls -la step?

@jugarpeupv
Copy link
Author

@gegoune no, only if a run a command in the term buffer

It might be related to the terminal width?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OS macOS specific to macOS
Projects
None yet
Development

No branches or pull requests

3 participants