diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-04-17 20:39:24 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-04-17 20:39:24 +0100 |
| commit | 52ffa98787dccc0ecd02b81b43df715dd9b6e9fe (patch) | |
| tree | 597888f789a5da8cc368d56f3d06aade3bb1bab2 | |
| parent | 7482d117cc85523e840dff595134dcb9cdc62207 (diff) | |
When not sending data to a subprocess, close its stdin
We were letting stdin untouched, which meant child processes had
access to our terminal input. That meant `!fmt` was trying to read
from our terminal input and catching keystrokes.
Fixes #1281
| -rw-r--r-- | src/shell_manager.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 357724b1..9404f97a 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -171,6 +171,8 @@ std::pair<String, int> ShellManager::eval( close(child_stdin.write_fd()); move(child_stdin.read_fd(), 0); } + else + close(0); close(child_stdout.read_fd()); move(child_stdout.write_fd(), 1); |
