Patch 8.0.1119

93 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 17, 2017, 2:32:52 PM9/17/17
to vim...@googlegroups.com

Patch 8.0.1119
Problem: Quitting a split terminal window kills the job. (Yasuhiro
Matsumoto)
Solution: Only stop terminal job if it is the last window.
Files: src/buffer.c, src/testdir/test_terminal.vim


*** ../vim-8.0.1118/src/buffer.c 2017-09-16 20:54:47.086560482 +0200
--- src/buffer.c 2017-09-17 19:03:48.433938340 +0200
***************
*** 466,473 ****
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
int wipe_buf = (action == DOBUF_WIPE);

#ifdef FEAT_TERMINAL
! if (bt_terminal(buf))
{
if (term_job_running(buf->b_term))
{
--- 466,492 ----
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
int wipe_buf = (action == DOBUF_WIPE);

+ /*
+ * Force unloading or deleting when 'bufhidden' says so.
+ * The caller must take care of NOT deleting/freeing when 'bufhidden' is
+ * "hide" (otherwise we could never free or delete a buffer).
+ */
+ if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
+ {
+ del_buf = TRUE;
+ unload_buf = TRUE;
+ }
+ else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
+ {
+ del_buf = TRUE;
+ unload_buf = TRUE;
+ wipe_buf = TRUE;
+ }
+ else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
+ unload_buf = TRUE;
+
#ifdef FEAT_TERMINAL
! if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
{
if (term_job_running(buf->b_term))
{
***************
*** 489,514 ****
wipe_buf = TRUE;
}
}
- else
#endif
- /*
- * Force unloading or deleting when 'bufhidden' says so.
- * The caller must take care of NOT deleting/freeing when 'bufhidden' is
- * "hide" (otherwise we could never free or delete a buffer).
- */
- if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
- {
- del_buf = TRUE;
- unload_buf = TRUE;
- }
- else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
- {
- del_buf = TRUE;
- unload_buf = TRUE;
- wipe_buf = TRUE;
- }
- else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
- unload_buf = TRUE;

#ifdef FEAT_AUTOCMD
/* Disallow deleting the buffer when it is locked (already being closed or
--- 508,514 ----
*** ../vim-8.0.1118/src/testdir/test_terminal.vim 2017-09-16 17:42:37.443279300 +0200
--- src/testdir/test_terminal.vim 2017-09-17 19:06:55.516835648 +0200
***************
*** 82,87 ****
--- 82,104 ----
unlet g:job
endfunc

+ func Test_terminal_split_quit()
+ let buf = Run_shell_in_terminal({})
+ call term_wait(buf)
+ split
+ quit!
+ call term_wait(buf)
+ sleep 50m
+ call assert_equal('run', job_status(g:job))
+
+ quit!
+ call WaitFor('job_status(g:job) == "dead"')
+ call assert_equal('dead', job_status(g:job))
+
+ exe buf . 'bwipe'
+ unlet g:job
+ endfunc
+
func Test_terminal_hide_buffer()
let buf = Run_shell_in_terminal({})
setlocal bufhidden=hide
*** ../vim-8.0.1118/src/version.c 2017-09-16 20:54:47.122560269 +0200
--- src/version.c 2017-09-17 18:51:49.642212786 +0200
***************
*** 763,764 ****
--- 763,766 ----
{ /* Add new patch number below this line */
+ /**/
+ 1119,
/**/

--
hundred-and-one symptoms of being an internet addict:
141. You'd rather go to http://www.weather.com/ than look out your window.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

h_east

unread,
Sep 18, 2017, 3:52:53 AM9/18/17
to vim_dev
Hi Bram and list,

2017-9-18(Mon) 3:32:52 UTC+9 Bram Moolenaar:


> Patch 8.0.1119
> Problem: Quitting a split terminal window kills the job. (Yasuhiro
> Matsumoto)
> Solution: Only stop terminal job if it is the last window.
> Files: src/buffer.c, src/testdir/test_terminal.vim

[...]

This patch hangs by doing the following operation.

$ vim --clean
:term
<C-w>v

--
Best regards,
Hirohito Higashi (h_east)

Bram Moolenaar

unread,
Sep 18, 2017, 5:08:21 AM9/18/17
to vim...@googlegroups.com, h_east

Hirohito Higashi wrote:

> 2017-9-18(Mon) 3:32:52 UTC+9 Bram Moolenaar:
> > Patch 8.0.1119
> > Problem: Quitting a split terminal window kills the job. (Yasuhiro
> > Matsumoto)
> > Solution: Only stop terminal job if it is the last window.
> > Files: src/buffer.c, src/testdir/test_terminal.vim
> [...]
>
> This patch hangs by doing the following operation.
>
> $ vim --clean
> :term
> <C-w>v

Works fine for me. Is this on MS-Windows perhaps?

--
hundred-and-one symptoms of being an internet addict:
148. You find it easier to dial-up the National Weather Service
Weather/your_town/now.html than to simply look out the window.

h_east

unread,
Sep 18, 2017, 5:19:24 AM9/18/17
to vim_dev
Hi Bram,

2017-9-18(Mon) 18:08:21 UTC+9 Bram Moolenaar:


> Hirohito Higashi wrote:
>
> > 2017-9-18(Mon) 3:32:52 UTC+9 Bram Moolenaar:
> > > Patch 8.0.1119
> > > Problem: Quitting a split terminal window kills the job. (Yasuhiro
> > > Matsumoto)
> > > Solution: Only stop terminal job if it is the last window.
> > > Files: src/buffer.c, src/testdir/test_terminal.vim
> > [...]
> >
> > This patch hangs by doing the following operation.
> >
> > $ vim --clean
> > :term
> > <C-w>v
>
> Works fine for me. Is this on MS-Windows perhaps?

My env.:
OS: fedora 25 (x64)
Vim: 8.0.1123 (./configure --enable-gui=gnome2 --enable-fail-if-missing)

Both CUI(vim --clean) and GUI(vim --clean -g) will occur.

In the case of GUI, it may occur even at <C-w>s

Bram Moolenaar

unread,
Sep 18, 2017, 3:25:31 PM9/18/17
to vim...@googlegroups.com, h_east

Hirohito Higashi wrote:

> > > 2017-9-18(Mon) 3:32:52 UTC+9 Bram Moolenaar:
> > > > Patch 8.0.1119
> > > > Problem: Quitting a split terminal window kills the job. (Yasuhiro
> > > > Matsumoto)
> > > > Solution: Only stop terminal job if it is the last window.
> > > > Files: src/buffer.c, src/testdir/test_terminal.vim
> > > [...]
> > >
> > > This patch hangs by doing the following operation.
> > >
> > > $ vim --clean
> > > :term
> > > <C-w>v
> >
> > Works fine for me. Is this on MS-Windows perhaps?
>
> My env.:
> OS: fedora 25 (x64)
> Vim: 8.0.1123 (./configure --enable-gui=gnome2 --enable-fail-if-missing)
>
> Both CUI(vim --clean) and GUI(vim --clean -g) will occur.
>
> In the case of GUI, it may occur even at <C-w>s

It depends on the Vim window size, if the two windows showing the same
terminal have a different size. I'll make a patch.

--
hundred-and-one symptoms of being an internet addict:
152. You find yourself falling for someone you've never seen or hardly
know, but, boy can he/she TYPE!!!!!!

h_east

unread,
Sep 19, 2017, 3:50:11 AM9/19/17
to vim_dev
Hi Bram and list,

2017-9-19(Tue) 4:25:31 UTC+9 Bram Moolenaar:


> Hirohito Higashi wrote:
>
> > > > 2017-9-18(Mon) 3:32:52 UTC+9 Bram Moolenaar:
> > > > > Patch 8.0.1119
> > > > > Problem: Quitting a split terminal window kills the job. (Yasuhiro
> > > > > Matsumoto)
> > > > > Solution: Only stop terminal job if it is the last window.
> > > > > Files: src/buffer.c, src/testdir/test_terminal.vim
> > > > [...]
> > > >
> > > > This patch hangs by doing the following operation.
> > > >
> > > > $ vim --clean
> > > > :term
> > > > <C-w>v
> > >
> > > Works fine for me. Is this on MS-Windows perhaps?
> >
> > My env.:
> > OS: fedora 25 (x64)
> > Vim: 8.0.1123 (./configure --enable-gui=gnome2 --enable-fail-if-missing)
> >
> > Both CUI(vim --clean) and GUI(vim --clean -g) will occur.
> >
> > In the case of GUI, it may occur even at <C-w>s
>
> It depends on the Vim window size, if the two windows showing the same
> terminal have a different size. I'll make a patch.

Regarding CUI, fixed at patch 8.0.1126. Thanks!
But, GUI is not fixed.

Step to reproduce:
- Start GUI VIm
$ vim --clean -g
- Open terminal window
:term
- Split Window vertically. (It will occur even if it split horizontally)
<C-w>v
- wait 5sec. (Probably, you can see the cursor is flickering)
- type `a`
a
- Vim has already hungs...

Kazunobu Kuriyama

unread,
Sep 19, 2017, 5:15:53 AM9/19/17
to vim...@googlegroups.com
FYI, on my PC, it is true that, for pure CUI and GTK+ 3, cursor flicker and hang-up are gone, and that the issue appears to be fixed, but CPU usage is still as high as movie players.  All CUI, Athena, Motif, GTK+ 2 and GTK+ 3 suffer with the same issue.

Kazunobu

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar

unread,
Sep 19, 2017, 4:08:32 PM9/19/17
to vim...@googlegroups.com, h_east
I can see the flickering, but not always. And it doesn't get stuck.

--
If you feel lonely, try schizophrenia.
Reply all
Reply to author
Forward
0 new messages