fish version 3.0.2.
I'd like to split the output of fzf --print0 (which writes NUL-delimited output) on NUL bytes and write it into a variable. As far as I'm aware, that requires fzf --print0 | string split0, otherwise all output after the first NUL byte will be cut off.
However, fzf also returns a meaningful exit code if it was aborted, and I'd like to do something with that exit code. Piping fzf into another command gives me no way to get at fzf's exit code.
Is there a way for me to have my cake and eat it too? :)
fish version 3.0.2.
I'd like to split the output of
fzf --print0(which writes NUL-delimited output) on NUL bytes and write it into a variable. As far as I'm aware, that requiresfzf --print0 | string split0, otherwise all output after the first NUL byte will be cut off.However,
fzfalso returns a meaningful exit code if it was aborted, and I'd like to do something with that exit code. Pipingfzfinto another command gives me no way to get atfzf's exit code.Is there a way for me to have my cake and eat it too? :)