jonas/tig

RFE: external command modifier to pause on error (rc != 0)

intelfx opened this issue · 1 comments

It is sometimes convenient to have an external command return to Tig instantly in case of success, but display the output (and wait for the user to understand the output) in case of an error (e.g. in particular any actions involving a merge).

Consider implementing an additional external command modifier (e.g. #) that would:

  • act as >-ish if a command exited successfully,
  • act as !-ish if the command exited with an error.

This modifier could then be combined with !, @ or + for different behavior on success:

  • !# to run the command synchronously attached to the tty (hiding tig while the command is running, then either returning to Tig like > or waiting for a key like ! depending on exit status),
  • @# to run the command in background attached to a pipe (behaving like @ on success, hiding tig and displaying captured output on error),
  • +# to run the command in background attached to a pipe (behaving like + on success, hiding tig and displaying captured output on error).

Looks to me that > already acts like ! if there is an error and since 2.5.10, + also reports errors (the first line) in the status window. It is not possible with the current io framework to change a bg command to a fg command in case of error.