mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
fix(defaults): auto-close terminal for &shell with args (#28276)
Problem: The `:terminal` auto-close logic does not support `&shell` that has arguments, e.g., `/bin/bash -O globstar`. Solution: Join `argv` and match `&shell`. This is not perfect since `&shell` may contain irregular spaces and quotes, but it seems to be good enough.
This commit is contained in:
parent
5ce6b4a294
commit
328a237351
@ -175,7 +175,7 @@ do
|
||||
end
|
||||
local info = vim.api.nvim_get_chan_info(vim.bo[args.buf].channel)
|
||||
local argv = info.argv or {}
|
||||
if #argv == 1 and argv[1] == vim.o.shell then
|
||||
if table.concat(argv, ' ') == vim.o.shell then
|
||||
vim.api.nvim_buf_delete(args.buf, { force = true })
|
||||
end
|
||||
end,
|
||||
|
Loading…
Reference in New Issue
Block a user