feat(terminal): surface exit code via virttext + nvim_get_chan_info #37987

Problem:
When a terminal process exits, "[Process Exited]" text is added
to the buffer contents.

Solution:
- Return `exitcode` field from `nvim_get_chan_info`.
- Show it in the default 'statusline'.
- Show exitcode as virtual text in the terminal buffer.
This commit is contained in:
Ayaan
2026-03-10 17:32:50 +05:30
committed by GitHub
parent 0cc4f53b40
commit c8693051a8
22 changed files with 132 additions and 57 deletions

View File

@@ -1309,6 +1309,7 @@ function vim.api.nvim_get_autocmds(opts) end
--- - "buffer" (optional) Buffer connected to |terminal| instance.
--- - "client" (optional) Info about the peer (client on the other end of the channel), as set
--- by |nvim_set_client_info()|.
--- - "exitcode" (optional) Exit code of the |terminal| process.
---
function vim.api.nvim_get_chan_info(chan) end