From ab65ab5d027e97ead372264a6ecfd3ac642299ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 25 Nov 2016 16:46:38 +0100 Subject: vis: fix I/O redirection bugs, cleanup vis_pipe The `:!` command did redirect stdout to a pipe which was used by `vis-menu` to return the selected entry. However, this breaks other interactive commands such as `:!/bin/sh` where command output was never displayed. Instead we modified `vis-menu` to re-open /dev/tty for its user interface which makes it work as a regular filter `:|` This patch also obsoletes the interactive flag previously passed to the vis_pipe function. Interactive mode is instead enabled by piping an invalid range. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index c558ced..1b6f14d 100644 --- a/main.c +++ b/main.c @@ -2147,7 +2147,7 @@ static char *get_completion_prefix(Vis *vis, Filerange (*text_object)(Text *, si static void insert_dialog_selection(Vis *vis, Filerange *range, const char *argv[]) { char *out = NULL, *err = NULL; - if (vis_pipe_collect(vis, range, true, argv, &out, &err) == 0) { + if (vis_pipe_collect(vis, range, argv, &out, &err) == 0) { View *view = vis_view(vis); size_t len = out ? strlen(out) : 0; for (Cursor *c = view_cursors(view); c; c = view_cursors_next(c)) { -- cgit v1.2.3