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

vim-patch:8.0.1119: quitting a split terminal window kills the job #10396

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jul 2, 2019

Problem: Quitting a split terminal window kills the job. (Yasuhiro
Matsumoto)
Solution: Only stop terminal job if it is the last window.
vim/vim@8adb0d0

The flow is a bit different there in nvim already, but this brings the code in line.

TODO:

  • explicit test
  • vim-8.0.1732.patch / vim-8.1.0342.patch (?)

Should/could we have testdir/test_terminal.vim in general to see/test that certain behavior is consistent with Vim?

@marvim marvim added the vim-patch See https://neovim.io/doc/user/dev_vimpatch.html label Jul 2, 2019
@blueyed
Copy link
Contributor Author

blueyed commented Jul 2, 2019

Affected test:

[  ERROR   ] 1 error, listed below:
[  ERROR   ] ...ojects/neovim/test/functional\autocmd\termclose_spec.lua @ 76: TermClose event reports the correct <abuf>
test\functional\helpers.lua:96: Vim(bdelete):E16: Invalid range
stack traceback:
	test\functional\helpers.lua:96: in function 'request'
	test\functional\helpers.lua:254: in function 'command'
	...ojects/neovim/test/functional\autocmd\termclose_spec.lua:89: in function <...ojects/neovim/test/functional\autocmd\termclose_spec.lua:76>

ci/common/suite.sh Outdated Show resolved Hide resolved
@blueyed blueyed changed the title vim-patch:8.0.1119: quitting a split terminal window kills the job [WIP/RFC] vim-patch:8.0.1119: quitting a split terminal window kills the job Jul 2, 2019
@justinmk
Copy link
Member

justinmk commented Jul 2, 2019

Should/could we have testdir/test_terminal.vim in general to see/test that certain behavior is consistent with Vim?

No. why? :terminal is tested in Lua, and matching Vim's :terminal behavior is not a goal.

Problem:    Quitting a split terminal window kills the job. (Yasuhiro
            Matsumoto)
Solution:   Only stop terminal job if it is the last window.
vim/vim@8adb0d0
… is closed

Missing part from vim-patch:8.0.0953.
@janlazo
Copy link
Contributor

janlazo commented Mar 11, 2020

This is missing 8.0.0953

--- a/src/buffer.c
+++ b/src/buffer.c
@@ -473,8 +473,8 @@ close_buffer(
    {
	if (term_job_running(buf->b_term))
	{
--	    if (wipe_buf)
--		/* Wiping out a terminal buffer kills the job. */
++	    if (wipe_buf || unload_buf)
++		/* Wiping out or unloading a terminal buffer kills the job. */
		free_terminal(buf);
	    else
	    {

@jcorbin
Copy link

jcorbin commented Mar 11, 2020

I made a plugin, mostly motivated by working around this: https://github.com/jcorbin/neovim-termhide ; basically, for me at least, :terminal is only currently usable in combination with setlocal bufhidden=hide ( ala https://github.com/jcorbin/neovim-termhide/blob/master/autoload/termhide.vim#L55 )

@dundargoc dundargoc changed the title [WIP/RFC] vim-patch:8.0.1119: quitting a split terminal window kills the job vim-patch:8.0.1119: quitting a split terminal window kills the job Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vim-patch See https://neovim.io/doc/user/dev_vimpatch.html
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants