neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 328a2373514a880ea80bed53d63de76e2dea2a9c
parent 5ce6b4a294216fb7e3cf4ee79ab3d3c7fde7cb1a
Author: Jaehwang Jung <tomtomjhj@gmail.com>
Date:   Sat, 13 Apr 2024 20:41:59 +0900

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.
Diffstat:
Mruntime/lua/vim/_defaults.lua | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua @@ -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,