mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
Add TermClose event
A terminal buffer now exits with: [Process exited <return value>] You can hook into it. E.g. :au TermClose * call feedkeys('<cr>') Closes #2293.
This commit is contained in:
@@ -21781,8 +21781,10 @@ static void on_process_exit(Process *proc, int status, void *d)
|
||||
TerminalJobData *data = d;
|
||||
if (data->term && !data->exited) {
|
||||
data->exited = true;
|
||||
terminal_close(data->term,
|
||||
_("\r\n[Program exited, press any key to close]"));
|
||||
char msg[22];
|
||||
snprintf(msg, sizeof msg, "\r\n[Process exited %d]", proc->status);
|
||||
terminal_close(data->term, msg);
|
||||
apply_autocmds(EVENT_TERMCLOSE, NULL, NULL, false, curbuf);
|
||||
}
|
||||
|
||||
if (data->status_ptr) {
|
||||
|
Reference in New Issue
Block a user