Hi Bram, 2017/8/30 Wed 5:45:21 UTC+9 Bram Moolenaar wrote: > Patch 8.0.1013 > Problem: A terminal window with a running job behaves different from a > window containing a changed buffer. > Solution: Do not set 'bufhidden' to "hide". Fix that a buffer where a > terminal used to run is listed as "[Scratch]". > Files: src/terminal.c, runtime/doc/terminal.txt, src/buffer.c
> ! So long as the job is running the window behaves like it contains a modified > ! buffer. Trying to close the window with `CTRL-W :close` or `CTRL-W :hide` > ! fails, unless "!" is added, in which case the job is ended. The text in the > ! window is lost. The buffer still exists, but getting it in a window with > ! `:buffer` will show an > ! empty buffer. > ! > ! You can use `CTRL-W :hide` to close the terminal window and make the buffer > ! hidden, the job keeps running. The `:buffer` command can be used to turn > the > ! current window into a terminal window. If there are unsaved changes this > ! fails, use ! to force, as usual. I think this document is slightly wrong. `CTRL-W :quit!` terminates the job, however `CTRL-W :close!` works as the same as `CTRL-W :hide` and doesn't terminate the job. How about the attached patch? Regards, Ken Takata -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
# HG changeset patch # Parent 9b031bea6a8b78fbb85664b31f560319f75ac794 diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -141,16 +141,15 @@ When the buffer associated with the term is killed, similar to calling `job_stop(job, "kill")` So long as the job is running the window behaves like it contains a modified -buffer. Trying to close the window with `CTRL-W :close` or `CTRL-W :hide` -fails, unless "!" is added, in which case the job is ended. The text in the -window is lost. The buffer still exists, but getting it in a window with -`:buffer` will show an -empty buffer. +buffer. Trying to close the window with `CTRL-W :close` or `CTRL-W :quit` +fails, unless "!" is added. In case of `CTRL-W :quit!` the job is ended. The +text in the window is lost. The buffer still exists, but getting it in a +window with `:buffer` will show an empty buffer. -You can use `CTRL-W :hide` to close the terminal window and make the buffer -hidden, the job keeps running. The `:buffer` command can be used to turn the -current window into a terminal window. If there are unsaved changes this -fails, use ! to force, as usual. +You can use `CTRL-W :hide` or `CTRL-W :close!` to close the terminal window +and make the buffer hidden, the job keeps running. The `:buffer` command can +be used to turn the current window into a terminal window. If there are +unsaved changes this fails, use ! to force, as usual. To have a background job run without a window, and open the window when it's done, use options like this: >
