Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
intelfx opened this issue Jun 6, 2024 · 1 comment
Open

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

intelfx opened this issue Jun 6, 2024 · 1 comment

Comments

@intelfx
Copy link

intelfx commented Jun 6, 2024

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).
@koutcher
Copy link
Collaborator

koutcher commented Jun 8, 2024

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.

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

No branches or pull requests

2 participants