From c6751f71215e8de86f86d2e131f00a869efa8bb8 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Fri, 15 Apr 2022 22:11:00 -0700 Subject: [PATCH] Do not capture all of fzf's output --- file_scripts/fzf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_scripts/fzf.py b/file_scripts/fzf.py index 09066e6..64ca0b0 100644 --- a/file_scripts/fzf.py +++ b/file_scripts/fzf.py @@ -55,8 +55,10 @@ def select_file_with_fzf(files): :raises: FZFError if there was an error with fzf or no file was selected """ try: + # if we use capture_output, it captures file selection dialog + # use subprocess.PIPE instead to prevent this output = subprocess.run( - (FZF_CMD, *FZF_OPTS), input=files, capture_output=True, check=True + (FZF_CMD, *FZF_OPTS), input=files, stdout=subprocess.PIPE, check=True ) except subprocess.CalledProcessError as e: raise FZFError(e.returncode, e.stderr) from e