Skip to content

Conversation

mhinz
Copy link
Member

@mhinz mhinz commented Nov 11, 2015

References #2293

A terminal buffer now exits with: [Process exited <return value>].

You can hook into it, e.g. :autocmd TermClose * call feedkeys('<cr>').

@mhinz mhinz changed the title [RFC] Events/termclose [RFC] Add TermClose event Nov 11, 2015
terminal_close(data->term,
_("\r\n[Program exited, press any key to close]"));
char *msg = xmalloc(24);
sprintf(msg, "[Process exited <%d>]", proc->status);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we had an asprintf() wrapper... oh well.

edit: after trying this out, I don't think the angle brackets are needed; [Process exited 255] is perfectly clear IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I did not mean to suggest literal brackets.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Will fix. ;]

@justinmk
Copy link
Member

Vim_diff.txt is mostly for backward incompatible changes...

@mhinz mhinz force-pushed the events/termclose branch 2 times, most recently from 1a34089 to c32e3f6 Compare November 11, 2015 12:18
@ZyX-I
Copy link
Contributor

ZyX-I commented Nov 11, 2015

@justinmk There is a section “new features” there.

@ZyX-I
Copy link
Contributor

ZyX-I commented Nov 11, 2015

(Also you may consider this backward incompatible: pretend that there are scripts which parse the whole :autocmd output and do not expect your event there :) )

@mhinz mhinz force-pushed the events/termclose branch 2 times, most recently from 3afcd77 to bb0311b Compare November 11, 2015 12:57
A terminal buffer now exits with: [Process exited <return value>]

You can hook into it. E.g.  :au TermClose * call feedkeys('<cr>')

Closes neovim#2293.
@mhinz mhinz force-pushed the events/termclose branch 2 times, most recently from 4090f2e to 2f2e57b Compare November 15, 2015 14:54
@mhinz mhinz merged commit ec847af into neovim:master Nov 15, 2015
mhinz added a commit that referenced this pull request Nov 15, 2015
@mhinz mhinz deleted the events/termclose branch November 15, 2015 16:06
justinmk added a commit that referenced this pull request Dec 5, 2015
- shada/msgpack editor plugin #3270
- VimL Dict notifications #3603
    - Note: API for this feature may change.
- :profile dump, :profile stop #2427
- :oldfiles! #3611
- TermOpen, TermClose events #3653
- fix: shada/viminfo: Do not save unlisted and quickfix buffers #3581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants