diff runtime/doc/terminal.txt @ 11914:4f7081eb1e26

Updated runtime files commit https://github.com/vim/vim/commit/f55e4c867f774d1f27973d06b07b97c0a4d6b968 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 1 20:44:53 2017 +0200 Updated runtime files
author Christian Brabandt <cb@256bit.org>
date Tue, 01 Aug 2017 21:00:06 +0200
parents be40c8a9240d
children a932d3da41c8
line wrap: on
line diff
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
-*terminal.txt*	For Vim version 8.0.  Last change: 2017 Jul 30
+*terminal.txt*	For Vim version 8.0.  Last change: 2017 Aug 01
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -48,6 +48,9 @@ See |CTRL-W| for more commands.
 Special in the terminal window:			*CTRL-W_.*  *CTRL-W_N* 
 	CTRL-W .	send a CTRL-W to the job in the terminal
 	CTRL-W N	go to Terminal Normal mode, see |Terminal-mode|
+	CTRL-W " {reg}  paste register {reg}		*CTRL-W_quote*
+			Also works with the = register to insert the result of
+			evaluating an expression.
 
 See option 'termkey' for specifying another key instead of CTRL-W that
 will work like CTRL-W.  However, typing 'termkey' twice sends 'termkey' to
@@ -76,21 +79,28 @@ Syntax ~
 			If [command] is not given the 'shell' option is used.
 
 			A new buffer will be created, using [command] or
-			'shell' as the name.  If a buffer by this name already
-			exists a number is added in parenthesis.
-			E.g. if "gdb" exists the second terminal buffer will
-			use "gdb (1)".
-
-			The window can be closed, in which case 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, using the existing
-			buffer.  If there are unsaved changes this fails, use
-			! to force, as usual.
+			'shell' as the name, prefixed with a "!".  If a buffer
+			by this name already exists a number is added in
+			parenthesis.  E.g. if "gdb" exists the second terminal
+			buffer will use "!gdb (1)".
 
 When the buffer associated with the terminal is wiped out the job is killed,
 similar to calling `job_stop(job, "kill")`
 
+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.
+
+When the job has finished and no changes were made to the buffer: closing the
+window will wipe out the buffer.
+
+Before changes can be made to a terminal buffer, the 'modifiable' option must
+be set.  This is only possible when the job has finished.  At the first change
+the buffer will become a normal buffer and the highlighting is removed.
+You may want to change the buffer name with |:file| to be able to write, since
+the buffer name will still be set to the command.
+
 
 Resizing ~
 
@@ -138,6 +148,23 @@ Unix ~
 On Unix a pty is used to make it possible to run all kinds of commands.  You
 can even run Vim in the terminal!  That's used for debugging, see below.
 
+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.
+
 
 MS-Windows ~
 
@@ -191,7 +218,7 @@ This opens three windows:
 
 This uses two terminal windows.  To open the gdb window: >
 	:term gdb [arguments]
-To open the terminal to run the tested program |term_open()| is used.
+To open the terminal to run the tested program |term_start()| is used.
 
 TODO