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:
Marco Hinz
2015-11-11 04:27:50 +01:00
parent ac4db4b814
commit 9fcd444036
8 changed files with 20 additions and 9 deletions

View File

@@ -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) {