diff options
Diffstat (limited to 'runtime/doc/nvim_terminal_emulator.txt')
-rw-r--r-- | runtime/doc/nvim_terminal_emulator.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index 557e714ddc..1b42892249 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -140,9 +140,9 @@ Example: >vim - |'channel'| Terminal PTY |job-id|. Can be used with |chansend()| to send input to the terminal. - The |TermClose| event gives the terminal job exit code in the |v:event| - "status" field. For example, this autocmd closes terminal buffers if the job - exited without error: >vim - autocmd TermClose * if !v:event.status | exe 'bdelete! '..expand('<abuf>') | endif + "status" field. For example, this autocommand outputs the terminal's exit + code to |:messages|: >vim + autocmd TermClose * echom 'Terminal exited with status '..v:event.status Use |jobwait()| to check if the terminal job has finished: >vim let running = jobwait([&channel], 0)[0] == -1 |