nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change-dir have an error when open a new terminal

BYT0723 opened this issue · comments

commented

Description

neovim report an error when open a terminal.
图片
Message means "Command execution failed"

Neovim version

NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

Linux 6.1.19-1-lts

nvim-tree version

1d79a64

Minimal config

require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS
	auto_reload_on_write = true,
	disable_netrw = false,
	hijack_cursor = false,
	hijack_netrw = true,
	hijack_unnamed_buffer_when_opening = false,
	ignore_buffer_on_setup = false,
	open_on_setup = false,
	open_on_setup_file = false,
	open_on_tab = false,
	sort_by = "name",
	respect_buf_cwd = false,
	view = {
		width = 40,
		hide_root_folder = false,
		side = "left",
		preserve_window_proportions = false,
		number = false,
		relativenumber = false,
		signcolumn = "yes",
		mappings = {
			custom_only = false,
			list = require("keybindings").nvim_tree(),
		},
	},
	renderer = {
		indent_markers = {
			enable = false,
			icons = {
				corner = "",
				edge = "",
				none = "  ",
			},
		},
		icons = theme.nvim_tree,
	},
	hijack_directories = {
		enable = true,
		auto_open = true,
	},
	update_focused_file = {
		enable = true,
		update_root = true,
		ignore_list = {},
	},
	ignore_ft_on_setup = {},
	system_open = {
		cmd = "xdg-open",
		args = {},
	},
	diagnostics = {
		enable = true,
		show_on_dirs = true,
		icons = {
			error = theme.diagnostic.error,
			warning = theme.diagnostic.warn,
			hint = theme.diagnostic.hint,
			info = theme.diagnostic.info,
		},
	},
	filters = {
		dotfiles = false,
		custom = {},
		exclude = {},
	},
	git = {
		enable = true,
		ignore = false,
		timeout = 400,
	},
	actions = {
		use_system_clipboard = true,
		change_dir = {
			enable = true,
			global = false,
			restrict_above_cwd = false,
		},
		open_file = {
			quit_on_open = true,
			resize_window = true,
			window_picker = {
				enable = true,
				chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
				exclude = {
					filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
					buftype = { "nofile", "terminal", "help" },
				},
			},
		},
	},
	trash = {
		cmd = "gio trash",
		require_confirm = true,
	},
	log = {
		enable = false,
		truncate = false,
		types = {
			all = false,
			config = false,
			copy_paste = false,
			diagnostics = false,
			git = false,
			profile = false,
		},
	},
})

Steps to reproduce

  1. open neovim
  2. NvimTreeOpen then open a terminal

Expected behavior

Errors will not affect the work of nvim-tree. when buftype is terminal, don't change-dir

Actual behavior

No response

commented

The same

I'm also seeing this, I suppose since the last update?

I noticed this when running tests using vim-test, but that's the same case as OP describes: opening a new terminal with nvim-tree open.

image

same here, when open terminal for the first time

same here

commented

Screenshot from 2023-03-16 15-21-39
the same with me, when i open toggle terminal at the first time, but after that it does not appear

commented
	update_focused_file = {
		enable = true,
		update_root = true,
		ignore_list = { "toggleterm" },
	},

just ignore termnial filetype

commented

图片
skip filetype of ignore_list, add skipping buftype, eg { terminal , notfile, quickfix }

commented
	update_focused_file = {
		enable = true,
		update_root = true,
		ignore_list = { "toggleterm", "term" },
	},

just ignore termnial filetype

when you use default terminal instead using toggleterm, please using above config. Thank @BYT0723

I get this error also, when using Hoffs/omnisharp-extended-lsp.nvim (using the feat/sourcegen-support branch) and opening metadata and source-generated C# buffers.

$metadata$ buffers were easy enough to add to the ignore_list... But for generated source files, I don't see a reliable convention to base an ignore_list item on; they just look like regular C# files, except that they don't exist.

source-generated buffer:
image

Minimum to replicate:

	update_focused_file = {
		enable = true,
		update_root = true,
	},