1

Consider the following example:

term_start(myprogram, {exit_cb: MyExitHandler})

def MyExitHandler()
  if exit_status != 0
    echom "Error!"
  endif
enddef

The function MyExitHandler is called when myprogram encounter some error OR when I wipe out the terminal buffer running myprogram. In both cases echom "Error!" is run. The program myprogram has only two exit statuses: 0 (success) and 1 (failure).

Is there a way where I can distinguish when myprogram detect an error and when the terminal buffer is wiped out so that I can have two different messages? If so how?

1
  • See :help term_setkill(), :help term_getjob(), and :help job_info().
    – romainl
    Commented Jul 13 at 7:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.