Do not capture all of fzf's output

This commit is contained in:
Eric Torres 2022-04-15 22:11:00 -07:00
parent 8a9976c86d
commit c6751f7121

View File

@ -55,8 +55,10 @@ def select_file_with_fzf(files):
:raises: FZFError if there was an error with fzf or no file was selected :raises: FZFError if there was an error with fzf or no file was selected
""" """
try: try:
# if we use capture_output, it captures file selection dialog
# use subprocess.PIPE instead to prevent this
output = subprocess.run( 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: except subprocess.CalledProcessError as e:
raise FZFError(e.returncode, e.stderr) from e raise FZFError(e.returncode, e.stderr) from e