diff --git a/vis.c b/vis.c index 004295b0b..2a4d6ae55 100644 --- a/vis.c +++ b/vis.c @@ -1960,7 +1960,10 @@ int vis_pipe(Vis *vis, File *file, Filerange *range, const char *argv[], vis->interrupted = false; vis->ui->terminal_restore(vis->ui); - return status; + if (WIFEXITED(status)) + return WEXITSTATUS(status); + + return -1; } static ssize_t read_buffer(void *context, char *data, size_t len) {