From 409d804ee85074eed8bd94f616bc23284bdf5eb9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 8 Jun 2015 22:42:51 +0100 Subject: Do not close stderr/stdout before program finish Programs like grep called in '$' command will fail due to SIGPIPE for example. So we need to keep the pipe open. --- src/normal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index 75fb2b20..8cd44a7b 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -396,7 +396,7 @@ void pipe(Context& context, NormalParams) str += '\n'; str = ShellManager::instance().eval( real_cmd, context, str, - ShellManager::Flags::ReadOutput, + ShellManager::Flags::WaitForStdout, {}, EnvVarMap{}).first; if ((insert_eol or sel.max() == buffer.back_coord()) and @@ -441,7 +441,7 @@ void insert_output(Context& context, NormalParams) return; auto str = ShellManager::instance().eval(real_cmd, context, {}, - ShellManager::Flags::ReadOutput, + ShellManager::Flags::WaitForStdout, {}, EnvVarMap{}).first; ScopedEdition edition(context); context.selections().insert(str, mode); -- cgit v1.2.3