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

Helix editor panics when started from xplr #449

Closed
Omnikar opened this issue Feb 24, 2022 · 14 comments
Closed

Helix editor panics when started from xplr #449

Omnikar opened this issue Feb 24, 2022 · 14 comments

Comments

@Omnikar
Copy link

Omnikar commented Feb 24, 2022

  • OS: MacOS 11.2.1
  • Terminal: iTerm2 3.4.12
  • xplr version: 0.17.2
  • Helix version: source build from commit 368064e3

When I try to start Helix from xplr, either via :e or even by typing hx into the shell opened by :!, it panics with the following panic message from crossterm:

thread 'main' panicked at 'reader source not set'

The panic message also gives that it occurred at src/event/read.rs:38:30 in crossterm.

@sayanarijit
Copy link
Owner

sayanarijit commented Feb 24, 2022

@sayanarijit
Copy link
Owner

sayanarijit commented Feb 26, 2022

The problem seems to be in macOS. But works fine on Linux (tested on the latest Manjaro).

@sayanarijit
Copy link
Owner

sayanarijit commented Feb 26, 2022

The deepest I could investigate was upto this function where helix tries to create a file descriptor pointing to the standard input or /dev/tty and apparently panics.

So I tried to run the following code from inside xplr terminal, hoping for it to panic:

use libc;
use std::fs;
use std::os::unix::io::{IntoRawFd, RawFd};

fn main() {
    unsafe { libc::isatty(libc::STDIN_FILENO) };
    fs::OpenOptions::new().read(true).write(true).open("/dev/tty").unwrap().into_raw_fd();
}

But it ran successfully.

@Omnikar
Copy link
Author

Omnikar commented Feb 26, 2022

Oh, it looks like crossterm-rs/crossterm#500 is the same issue as what prevented Helix's "pipe into a buffer on startup" feature from working on MacOS.

@sayanarijit
Copy link
Owner

Seems like it's fixed in the latest version of helix editor.

helix-xplr

Hence, closing this issue.

@Omnikar
Copy link
Author

Omnikar commented Jul 27, 2022

Seems like it's fixed in the latest version of helix editor.

I updated to the latest versions of Helix and xplr, but I'm still getting the same exact error.

@sayanarijit sayanarijit reopened this Jul 27, 2022
@sayanarijit
Copy link
Owner

Can you confirm the correct binary is run in the xplr shell? Spawn the shell using :! and check version "$EDITOR --version"

@Omnikar
Copy link
Author

Omnikar commented Jul 30, 2022

Can you confirm the correct binary is run in the xplr shell? Spawn the shell using :! and check version "$EDITOR --version"

It's Helix 22.05, the latest version.

@tait-adam
Copy link

Was there any solution to this in the end?

• MacOS 11.7
• Kitty terminal 0.26.2
• xplr 0.19.3
• hx 22.08.1

Having the same problem

@sayanarijit
Copy link
Owner

Ah, so it's macOS specific. I currently don't have access to a macOS, but it sounds like the issue is related to one of the crossterm issues linked above. Need help to confirm this by a macOS user.

@taupiqueur
Copy link

I’ve been able to start Helix from xplr on macOS using @yyogo’s patch.

helix-editor/helix#2111

@tait-adam
Copy link

I’ve been able to start Helix from xplr on macOS using @yyogo’s patch.

helix-editor/helix#2111

Works perfectly. Thanks

@sayanarijit
Copy link
Owner

Hope it gets fixed in crossterm/helix soon. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants