New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lnav re-emits piped input on quit #436
Comments
Hello, |
@xapienz thanks, that helps! However, now, it just hangs on quit (as if still processing stuff but just not printing it) until I hit ctrl+c Is there a way to fix that? And shouldn't |
I'm sorry but |
@oryband Can you provide a gif or something? I can't reproduce this... |
@tstack I have to mention |
Any news on this? Can anyone try piping |
I take it back. This indeed works with latest lnav (0.8.3). I was using an older version on AWS Ubuntu 16.04. Thanks for the help. |
I can confirm that IMHO it would be more intuitive if it didn't output to STDOUT on exit unless an option was specified. |
I can confirm this also. |
@tstack Any thoughts on this? I did some digging, and found that the Lines 1941 to 1943 in ffd9d88
and used here: Lines 2478 to 2546 in ffd9d88
and here when reading from stdin (the comment reveals some of the thinking behind this feature, which shows that it was deliberate): Lines 2589 to 2617 in ffd9d88
|
Given the comment immediately above, it was deliberately implemented so presumably some people must like the current behaviour, but equally others who jumped on this issue report would prefer the |
I implemented the behavior because I don't want to lose the output that was piped into lnav and I tend to be lazy about using the |
@tstack Thanks, that's a great idea which works really well for the use case of analyzing the outputs of builds! However I really don't think it makes sense for the Here's a crazy idea: how about teaching lnav to look at what's on the other end of the pipe (i.e. the writer) and then automatically adjust its behaviour accordingly? If it's some kind of compiler / |
I was looking at that so that I could save a note with the capture file to make it easier to where the data came from. But, I don't think there's a portable/reliable way to make that work.
The stdin data was already being saved to a file so that scrollback could be supported. Beyond that, disks are big, saving a copy of some text is not a huge deal. The capture files are removed if they're older than a day and they aren't saved if they're too big (10MB). I could also compress the captures to save even more space. So, I don't think this will be a problem in practice.
I would say the current behavior of piping data into |
When piping the output of a program into lnav, the data would be dumped to the terminal on exit so that it would not be lost. Since that is a bit noisy, the temp file used to store the data is now left in .lnav so that it can be reopened later. Older stdin captures are automatically removed after a day. Also took the opportunity to start using filesystem::path more. Fixes tstack#436
If I run something like:
then lnav receives and displays the piped input correctly, but when I hit
q
to quit, after lnav's UI vanishes the same log lines are also output again to the terminal. When the piped input is long (e.g. replacing thetail
command withjournalctl
) then this becomes quite an inconvenience.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: