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. --- vis-cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vis-cmds.c') diff --git a/vis-cmds.c b/vis-cmds.c index 7218676..11a92dc 100644 --- a/vis-cmds.c +++ b/vis-cmds.c @@ -265,8 +265,8 @@ static const char *file_open_dialog(Vis *vis, const char *pattern) { if (!buffer_put0(&bufcmd, VIS_OPEN " ") || !buffer_append0(&bufcmd, pattern ? pattern : "")) return NULL; - Filerange empty = text_range_empty(); - int status = vis_pipe(vis, &empty, true, (const char*[]){ buffer_content0(&bufcmd), NULL }, + Filerange empty = text_range_new(0,0); + int status = vis_pipe(vis, &empty, (const char*[]){ buffer_content0(&bufcmd), NULL }, &bufout, read_buffer, &buferr, read_buffer); if (status == 0) -- cgit v1.2.3