Skip to content
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

Fix crash if log file can't be opened #1937

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

joelim-work
Copy link
Collaborator

If a log file is specified and can't be opened (e.g. lf -log /foo), then the application will panic. This happens after the TUI has been initialized so the terminal is left in a messed up state, instead of being restored after a normal exit.

This commit moves the code for opening the log file to before the TUI initialization, so that a failure will cause lf to abort with an error message without affecting the terminal.

@joelim-work joelim-work added the fix Pull requests that fix existing behavior label Mar 21, 2025
@joelim-work joelim-work added this to the r35 milestone Mar 21, 2025
@joelim-work joelim-work merged commit ad6fa3f into gokcehan:master Mar 21, 2025
4 checks passed
@joelim-work joelim-work deleted the fix-log-file-crash branch March 21, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix existing behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't crash on unavailable log file
1 participant