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

Graceful error recovery for files with no read permission #12322

Open
NikitaRevenco opened this issue Dec 23, 2024 · 1 comment
Open

Graceful error recovery for files with no read permission #12322

NikitaRevenco opened this issue Dec 23, 2024 · 1 comment
Labels
C-enhancement Category: Improvements

Comments

@NikitaRevenco
Copy link
Contributor

NikitaRevenco commented Dec 23, 2024

If you try to open a file which the user can't read, helix will throw an error:

$ touch file
$ chmod -r file
$ hx file
Error: unable to start Helix

Caused by:
    Permission denied (os error 13)

But we get the same error if we try to open multiple files, even if some of them are readable

$ touch file{1..10}
$ chmod -r file1
$ hx file{1..10}
Error: unable to start Helix

Caused by:
    Permission denied (os error 13)

Desirable outcome

If you open multiple files but some of them can't be read, Helix should open the ones that can be, and set a message which files failed to open

I'm thinking that a status message should be set like this:

Opened 10 files, but couldn't open 4:
- abc.txt
- xyz.txt
- 123.txt
- 111.txt

Currently the status message is limited to a single one. When #12241 is merged this can be implemented

@NikitaRevenco NikitaRevenco added the C-enhancement Category: Improvements label Dec 23, 2024
@kirawi
Copy link
Member

kirawi commented Dec 23, 2024

pub fn readonly(p: &Path) -> bool {
should be used. I'm surprised it wasn't already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants