diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-11-25 16:46:38 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-11-25 17:07:39 +0100 |
| commit | ab65ab5d027e97ead372264a6ecfd3ac642299ba (patch) | |
| tree | 747a869eadeed1effb902298b90cd828fa7ba806 /register.c | |
| parent | 1c9c52647fe2984472246eb2c12b3412fd5fafa4 (diff) | |
| download | vis-ab65ab5d027e97ead372264a6ecfd3ac642299ba.tar.gz vis-ab65ab5d027e97ead372264a6ecfd3ac642299ba.tar.xz | |
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.
Diffstat (limited to 'register.c')
| -rw-r--r-- | register.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -29,7 +29,7 @@ const char *register_get(Vis *vis, Register *reg, size_t *len) { buffer_init(&buferr); buffer_clear(®->buf); - int status = vis_pipe(vis, &(Filerange){ .start = 0, .end = 0 }, false, + int status = vis_pipe(vis, &(Filerange){ .start = 0, .end = 0 }, (const char*[]){ VIS_CLIPBOARD, "--paste", NULL }, ®->buf, read_buffer, &buferr, read_buffer); @@ -70,7 +70,7 @@ bool register_put_range(Vis *vis, Register *reg, Text *txt, Filerange *range) { Buffer buferr; buffer_init(&buferr); - int status = vis_pipe(vis, range, false, (const char*[]){ VIS_CLIPBOARD, "--copy", NULL }, + int status = vis_pipe(vis, range, (const char*[]){ VIS_CLIPBOARD, "--copy", NULL }, NULL, NULL, &buferr, read_buffer); if (status != 0) |
