toggle text file view may terminate lnav directly
lnav version master (0.12.4-177-gc8e7248)
Describe the bug
When view text files, lnav terminated directly when I hit hotkey "t".
Lnav terminated with log "text view popped and no other files, exiting..."
To Reproduce Steps to reproduce the behavior:
-
echo a > /tmp/a -
lnav /tmp/a - keyin "t"; then lnav terminated immediately without any messages
Why it is not good to terminate lnav this way:
- For users like me, running "program | lnav" and unfortunately the output is not log format. lnav termination means the output is lost.
- it terminated without any UI messages and confused users. If termination is the desired behavior, it is better to show messages and/or confirm with user.
running "program | lnav" and unfortunately the output is not log format. lnav termination means the output is lost.
Hmm, the output shouldn't be lost, though. lnav stores the input in a file in order to support scrollback. On exit, lnav should print a message explaining as much and the command to run to reopen the file:
% echo hello | lnav
ⓘ info: 1.8KB of data from stdin was captured and will be saved for one day. You can reopen it by running:
lnav piper://p-5bc17675aaa0a87813cd78a284e539f3-000
Thanks. The other issue is, the program may terminate due to broken pipe and I need to rerun it.
I've changed the behavior to not pop the TEXT view when pressing "t" and there are only text files loaded.
Thanks.