1
0
forked from aniani/vim

patch 8.0.0864: cannot specify the name of a terminal

Problem:    Cannot specify the name of a terminal.
Solution:   Add the "term_name" option. (Yasuhiro Matsumoto, closes #1936)
This commit is contained in:
Bram Moolenaar
2017-08-05 14:50:12 +02:00
parent 69198197fd
commit 78712a7733
6 changed files with 55 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 03
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -8008,7 +8008,23 @@ term_start({cmd}, {options}) *term_start()*
Returns the buffer number of the terminal window.
When opening the window fails zero is returned.
{options} are not implemented yet.
{options} are similar to what is used for |job_start()|, see
|job-options|. However, not all options can be used. These
are supported:
all timeout options
"stoponexit"
"out_cb", "err_cb"
"exit_cb", "close_cb"
"in_io", "in_top", "in_bot", "in_name", "in_buf"
"out_io", "out_name", "out_buf", "out_modifiable", "out_msg"
"err_io", "err_name", "err_buf", "err_modifiable", "err_msg"
However, at least one of stdin, stdout or stderr must be
connected to the terminal. When I/O is connected to the
terminal then the callback function for that part is not used.
There is one extra option:
"term_name" name to use for the buffer name, instead of
the command name.
term_wait({buf}) *term_wait()*
Wait for pending updates of {buf} to be handled.

View File

@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 01
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -92,10 +92,14 @@ Syntax ~
When the buffer associated with the terminal is wiped out the job is killed,
similar to calling `job_stop(job, "kill")`
By default the 'bufhidden' option of the buffer will be set to "hide".
So long as the job is running: If the window is closed the buffer becomes
hidden. The command will not be stopped. 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.
*E947*
So long as the job is running, the buffer is considered modified and Vim
cannot be quit easily, see |abandon|.
When the job has finished and no changes were made to the buffer: closing the
window will wipe out the buffer.
@@ -147,23 +151,6 @@ displayed.
In Terminal mode the statusline and window title show "(Terminal)". If the
job ends while in Terminal mode this changes to "(Terminal-finished)".
Environment variables are used to pass information to the running job:
TERM name of the terminal, 'term'
ROWS number of rows in the terminal initially
LINES same as ROWS
COLUMNS number of columns in the terminal initially
COLORS number of colors, 't_Co' (256*256*256 in the GUI)
VIM_SERVERNAME v:servername
The |client-server| feature can be used to communicate with the Vim instance
where the job was started. This only works when v:servername is not empty.
If needed you can set it with: >
call remote_startserver('vim-server')
In the job you can then do something like: >
vim --servername $VIM_SERVERNAME --remote +123 some_file.c
This will open the file "some_file.c" and put the cursor on line 123.
Unix ~