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

MacOS 10.14 No application knows how to open - panic #91

Open
costincaraivan opened this issue Jan 9, 2020 · 13 comments
Open

MacOS 10.14 No application knows how to open - panic #91

costincaraivan opened this issue Jan 9, 2020 · 13 comments
Labels

Comments

@costincaraivan
Copy link

costincaraivan commented Jan 9, 2020

Describe the bug
broot crashes on MacOS/zsh if $EDITOR is undefined and is used to open a file.

To Reproduce

  1. brew install broot
  2. allow it to setup .zshrc
  3. launch br
  4. filter .gradle files (no $EDITOR defined)
gradle                                                                                                    h:n   gi:athread

'<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:1165:5

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Open Error : "command \'open\' did not execute successfully; exit code: 1\ncommand stderr:\nNo application knows how to open [...]build.gradle."

Expected behavior
broot either opens the build.gradle file with $EDITOR, or if $EDITOR is undefined, asks the user to set it. broot doesn't crash/panic.

Configuration (please complete the following information):

  • broot 0.10.3 installed with brew
  • OS: MacOS
  • Version 10.14
  • zsh 5.3 (x86_64-apple-darwin18.0)

Additional information
Broot also messes up iTerm2 at the end, using the mouse wheel to scroll prints characters instead of scrolling. I have to reset to get the terminal back to normal.

@JAStanton
Copy link

Digging around I found the config file (~/Library/Preferences/org.dystroy.broot/conf.toml or in broot type ? and scroll down using arrow keys and it lists the config file location)

Inside there I found it mentions $EDITOR:

# If $EDITOR isn't set on your computer, you should either set it
#  or just replace it with your editor of choice in the 'execution'
#  pattern.
# Example:
#  execution = "/usr/bin/nvim {file}"
[[verbs]]
invocation = "edit"
key = "F2"
shortcut = "e"
execution = "$EDITOR {file}"
@MJJBennett
Copy link

MJJBennett commented Jan 9, 2020

I also just installed Broot to try it out through Brew on MacOS 10.15.2, I edited the mentioned conf.toml to replace both instances of $EDITOR with vim and pressing enter on a file to open it still lags for a little before opening up a xcode window asking me to install new tools for debugging.

(Fast edit)
To clarify, here is the window that appears when attempting to edit a file:
image

It is worth noting that I just tried to replace vim with the absolute path to vim on my system and that also did not fix the issue.

Second note: I installed and tested Broot 0.11.4 and found the same problem to exist.

@Canop Canop added the Mac label Oct 4, 2020
@Integralist
Copy link

👋🏻 I installed from source and have version 1.7.3.

If I try to press <Enter> then I get an error about no application knows how to open this file, and some times it would slowly open the xcode prompt. This is although I have $EDITOR already set to vim.

I then tried the -> arrow and this had the same issue.

If I do :e it works fine and opens in vim.

I then noticed in the file browser ui on macOS that the default app for most unknown files is XCode. I changed it (just out of interest) to the text.app program and now if I use -> or <Enter> then text.app gets used? So it looks like broot isn't respecting the $EDITOR environment variable unless using :e and instead uses the file system's recognised editor.

@Canop
Copy link
Owner

Canop commented Nov 26, 2021

So it looks like broot isn't respecting the $EDITOR environment variable unless using :e and instead uses the file system's recognised editor

Yes, this is by design. It can be changed in configuration. See https://dystroy.org/broot/tricks/#change-standard-file-opening

@Integralist
Copy link

Thanks @Canop!

Thinking about this more it makes perfect sense that what you described would be the default.

If I press <Enter> on an image, then I want whatever the default app for handling images to continue to do that and not open in vim.

So yeah having Enter behave differently to :e makes sense to me now 👍🏻

@Canop
Copy link
Owner

Canop commented Dec 1, 2021

Can we close the issue now ?

@costincaraivan
Copy link
Author

costincaraivan commented Dec 1, 2021

Expected behavior
broot either opens the build.gradle file with $EDITOR, or if $EDITOR is undefined, asks the user to set it. broot doesn't crash/panic.

Well, I guess it depends if you agree with my expected behavior. If you don't, then yes, it can be closed.

Personally I don't think an application should just crash, even in case of misconfiguration (which is debatable, at this point you don't even know about the configuration files).

@Canop
Copy link
Owner

Canop commented Dec 1, 2021

Oh, I missed the crash.

Sorry, too many open projects and not enough time... I clearly overlooked the issue. The crash must be solved, yes.

@Canop
Copy link
Owner

Canop commented Dec 3, 2021

Can somebody who reproduces this crash do it with RUST_BACKTRACE=1 and give me the backtrace ?

@bestlem
Copy link

bestlem commented Mar 27, 2024

I don't get a crash but a garbled error message with

br --version
broot 1.36.1

Screenshot 2024-03-27 at 14 07 05

@Canop
Copy link
Owner

Canop commented Mar 27, 2024

You'll get a clearer error message by widening your terminal or by looking in the log.

@bestlem
Copy link

bestlem commented Mar 27, 2024

Thanks

The error message is still too long if it is full screen. (but enough to recognise it). - it was not having sweet in finder a handler for this.

For the log I have to restart and repeat the same actions?

@Canop
Copy link
Owner

Canop commented Mar 27, 2024

For the log I have to restart and repeat the same actions?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 participants