summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-03-10 20:28:12 +0100
committerBram Moolenaar <Bram@vim.org>2018-03-10 20:28:12 +0100
commit25cdd9c33b21ddbd31321c075873bb225450d2d2 (patch)
tree380538cdf0abb9b7f3777c57ada6930930c9e036 /runtime
parentb5b7562475ad032a174b893286172de0d2c157cd (diff)
downloadvim-git-25cdd9c33b21ddbd31321c075873bb225450d2d2.tar.gz
patch 8.0.1593: :qall never exits with an active terminal windowv8.0.1593
Problem: :qall never exits with an active terminal window. Solution: Add a way to kill a job in a terminal window.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt19
-rw-r--r--runtime/doc/terminal.txt13
2 files changed, 28 insertions, 4 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e153f2fe3..737233365 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.0. Last change: 2018 Mar 09
+*eval.txt* For Vim version 8.0. Last change: 2018 Mar 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2435,6 +2435,7 @@ term_gettty({buf}, [{input}]) String get the tty name of a terminal
term_list() List get the list of terminal buffers
term_scrape({buf}, {row}) List get row of a terminal screen
term_sendkeys({buf}, {keys}) none send keystrokes to a terminal
+term_setkill({buf}, {how}) none set signal to stop job in terminal
term_setrestore({buf}, {command}) none set command to restore terminal
term_start({cmd}, {options}) Job open a terminal window and run a job
term_wait({buf} [, {time}]) Number wait for screen to be updated
@@ -8276,6 +8277,8 @@ term_getline({buf}, {row}) *term_getline()*
The first line has {row} one. When {row} is "." the cursor
line is used. When {row} is invalid an empty string is
returned.
+
+ To get attributes of each character use |term_scrape()|.
{only available when compiled with the |+terminal| feature}
term_getscrolled({buf}) *term_getscrolled()*
@@ -8361,6 +8364,18 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
means the character CTRL-X.
{only available when compiled with the |+terminal| feature}
+term_setkill({buf}, {how}) *term_setkill()*
+ When exiting Vim or trying to close the terminal window in
+ another way, {how} defines whether the job in the terminal can
+ be stopped.
+ When {how} is empty (the default), the job will not be
+ stopped, trying to exit will result in |E947|.
+ Otherwise, {how} specifies what signal to send to the job.
+ See |job_stop()| for the values.
+
+ After sending the signal Vim will wait for up to a second to
+ check that the job actually stopped.
+
term_setrestore({buf}, {command}) *term_setrestore()*
Set the command to write in a session file to restore the job
in this terminal. The line written in the session file is: >
@@ -8416,6 +8431,8 @@ term_start({cmd}, {options}) *term_start()*
"hidden" do not open a window
"norestore" do not add the terminal window to a
session file
+ "term_kill" what to do when trying to close the
+ terminal window, see |term_setkill()|
"term_finish" What to do when the job is finished:
"close": close any windows
"open": open window if needed
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index ff7950c86..d6c3d199f 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
-*terminal.txt* For Vim version 8.0. Last change: 2018 Mar 09
+*terminal.txt* For Vim version 8.0. Last change: 2018 Mar 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -166,6 +166,9 @@ Syntax ~
no window will be used.
++norestore Do not include this terminal window
in a session file.
+ ++kill={how} When trying to close the terminal
+ window kill the job with {how}. See
+ |term_setkill()| for the values.
++rows={height} Use {height} for the terminal window
height. If the terminal uses the full
Vim height (no window above or below
@@ -189,8 +192,12 @@ Syntax ~
If you want to use more options use the |term_start()|
function.
-When the buffer associated with the terminal is unloaded or wiped out the job
-is killed, similar to calling `job_stop(job, "kill")`
+When the buffer associated with the terminal is forcibly unloaded or wiped out
+the job is killed, similar to calling `job_stop(job, "kill")` .
+Closing the window normally results in |E947|. When a kill method was set
+with "++kill={how}" or |term_setkill()| then closing the window will use that
+way to kill or interrupt the job. For example: >
+ :term ++kill=term tail -f /tmp/log
So long as the job is running the window behaves like it contains a modified
buffer. Trying to close the window with `CTRL-W :quit` fails. When using