|
1 | | -*terminal.txt* For Vim version 9.2. Last change: 2026 Mar 12 |
| 1 | +*terminal.txt* For Vim version 9.2. Last change: 2026 Apr 02 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -944,9 +944,26 @@ term_start({cmd} [, {options}]) *term_start()* |
944 | 944 | "in_io", "in_top", "in_bot", "in_name", "in_buf" |
945 | 945 | "out_io", "out_name", "out_buf", "out_modifiable", "out_msg" |
946 | 946 | "err_io", "err_name", "err_buf", "err_modifiable", "err_msg" |
947 | | - However, at least one of stdin, stdout or stderr must be |
948 | | - connected to the terminal. When I/O is connected to the |
949 | | - terminal then the callback function for that part is not used. |
| 947 | + On Unix: |
| 948 | + stdin, stdout, and stderr are connected to a pty by default, |
| 949 | + since bidirectional communication with the terminal is |
| 950 | + required. Setting "out_cb" does not switch stdout from the |
| 951 | + pty to a pipe. Only setting "err_cb" switches stderr to a |
| 952 | + pipe. |
| 953 | + Note: Since a pty is line-buffered and a pipe is |
| 954 | + block-buffered, the order of output between stdout and stderr |
| 955 | + may not be preserved. Without "err_cb", stderr uses the same |
| 956 | + pty as stdout, so the output order is preserved but stdout and |
| 957 | + stderr cannot be distinguished. |
| 958 | + |
| 959 | + On MS-Windows with |ConPTY|: |
| 960 | + stdin, stdout, and stderr are always connected through pipes |
| 961 | + to the pseudo console, regardless of callback settings. |
| 962 | + Since stdout and stderr share the same pipe, they cannot be |
| 963 | + separated by "err_cb". |
| 964 | + This is because the CreatePseudoConsole() API only accepts one |
| 965 | + input and one output handle, with no separate handle for |
| 966 | + stderr. |
950 | 967 |
|
951 | 968 | There are extra options: |
952 | 969 | "term_name" name to use for the buffer name, instead |
|
0 commit comments