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

Panic when opening a symlink #2246

Closed
n0s4 opened this issue Apr 24, 2022 · 1 comment · Fixed by #2718
Closed

Panic when opening a symlink #2246

n0s4 opened this issue Apr 24, 2022 · 1 comment · Fixed by #2718
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@n0s4
Copy link
Contributor

n0s4 commented Apr 24, 2022

Summary

I have a symlink to the runtime/ in my ~/.config/helix . I wanted to open a theme in runtime/themes inside Helix so I opened the file picker. The symlink showed up but not any files within the actual folder. When I put the pointer on the runtime symlink the preview box says <File not found>. When I press enter on the symlink Helix panics:

thread 'main' panicked at 'editor.open failed: Is a directory (os error 21)', helix-term/src/ui/mod.rs:185:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This doesn't seem very mysterious. I guess following symlinks just isn't implemented yet in the file picker, Helix shouldn't crash because of it though.

Reproduction Steps

I tried this:

  1. Open helix in the config folder.
  2. Open the file picker and select the runtime symlink

I expected this to happen:

Helix would show the files in the folder the symlink points to.

Instead, this happened:

Helix panics.

Helix log

~/.cache/helix/helix.log These are the latest 10 lines of `helix.log`. Nothing looks relevant.
2022-04-24T11:49:36.554 helix_view::theme [WARN] Theme: invalid style attribute: modifers
2022-04-24T11:49:36.562 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { LSP not defined }
2022-04-24T11:50:09.881 helix_view::theme [WARN] Theme: invalid style attribute: modifers
2022-04-24T11:50:09.881 helix_view::theme [WARN] Theme: invalid style attribute: modifers
2022-04-24T11:50:09.905 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { LSP not defined }
2022-04-24T11:50:49.229 helix_view::theme [WARN] Theme: invalid style attribute: modifers
2022-04-24T11:50:49.230 helix_view::theme [WARN] Theme: invalid style attribute: modifers
2022-04-24T11:50:49.252 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { LSP not defined }
2022-04-24T11:58:26.687 helix_view::theme [WARN] Theme: invalid style attribute: modifers
2022-04-24T11:58:26.687 helix_view::theme [WARN] Theme: invalid style attribute: modifers

Platform

Linux

Terminal Emulator

alacritty

Helix Version

22.03-127-g2c7f770a

@n0s4 n0s4 added the C-bug Category: This is a bug label Apr 24, 2022
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Apr 24, 2022
@aral
Copy link
Contributor

aral commented Apr 30, 2022

@n0s4 Just did exactly the same thing as you :)

zen3ger added a commit to zen3ger/helix that referenced this issue Jun 12, 2022
- Add file-picker.follow-symlinks configuration option (default is true), this
  also controls if filename and directory completers follow symlinks.

- Update FilePicker to set editor error if opening a file fails, instead of
  panicing.

Fix helix-editor#1548
Fix helix-editor#2246
archseer pushed a commit that referenced this issue Jun 15, 2022
- Add file-picker.follow-symlinks configuration option (default is true), this
  also controls if filename and directory completers follow symlinks.

- Update FilePicker to set editor error if opening a file fails, instead of
  panicing.

Fix #1548
Fix #2246
lazytanuki pushed a commit to lazytanuki/helix that referenced this issue Jun 21, 2022
- Add file-picker.follow-symlinks configuration option (default is true), this
  also controls if filename and directory completers follow symlinks.

- Update FilePicker to set editor error if opening a file fails, instead of
  panicing.

Fix helix-editor#1548
Fix helix-editor#2246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants