1 year ago
#338242
doplumi
Show whole lines while piping live logs to fzf
I'm trying to pipe logs to fzf so that I'll be able to filter them live, as my program spits a lot of logs out.
However, I've noticed the long lines get truncated and I have no way to show the whole lines, except to press ENTER
, at which point the line will be displayed in it's entirety but the logs will be deleted from the screen and the program will crash with the error failed printing to stdout: Broken pipe (os error 32)'
It seems fzf
supports this feature, as it has a --no-hscroll: Disable horizontal scroll
flag, implying horizontal scroll is available by default, but arrow keys don't work, at least not alone or with the usual modifiers.
I've also tried using less -S
for this, but doesn't work on live logs as it doesn't resume following after the first interrupt and F
command.
As an alternative, I've noticed fzf
supports a preview window feature, it would be neat to have the whole line display there so that the logs are still visible and scrolling while following the lines.
I could append logs to a file and try working from there, but is that necessary? Or can these tools also work properly on live stdout
logs?
fzf
0 Answers
Your Answer