summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Metzidis <anthony.metzidis@gmail.com>2020-01-19 02:42:10 -0800
committerJunegunn Choi <junegunn.c@gmail.com>2020-01-19 19:42:10 +0900
commitf246fb2fc2b7bc04e9504dc0705a63d74a6c90ce (patch)
treeebf1d40a59472035d28a34a2b4cc850e80d1c0a1
parentf7b26b34cbaf5a385bca8b6dd14eb5981e42d133 (diff)
Show error message when failed to start preview command (#1810)
Fix #1637
-rw-r--r--.gitignore1
-rw-r--r--README.md3
-rw-r--r--src/terminal.go5
3 files changed, 7 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index d61bd411..b76a3f1a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ doc/tags
vendor
gopath
*.zwc
+fzf
diff --git a/README.md b/README.md
index 4ee7d100..7d360654 100644
--- a/README.md
+++ b/README.md
@@ -480,7 +480,8 @@ See *KEY BINDINGS* section of the man page for details.
### Preview window
When `--preview` option is set, fzf automatically starts an external process with
-the current line as the argument and shows the result in the split window.
+the current line as the argument and shows the result in the split window. Your
+`$SHELL` is used to execute the command with `$SHELL -c COMMAND`
```bash
# {} is replaced to the single-quoted string of the focused line
diff --git a/src/terminal.go b/src/terminal.go
index f31ed1ef..56085be1 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -1576,7 +1576,10 @@ func (t *Terminal) Loop() {
var out bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &out
- cmd.Start()
+ err := cmd.Start()
+ if err != nil {
+ out.Write([]byte(err.Error()))
+ }
finishChan := make(chan bool, 1)
updateChan := make(chan bool)
go func() {