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

open: No application knows how to open * #5091

Closed
theScrabi opened this issue Jul 11, 2018 · 7 comments
Closed

open: No application knows how to open * #5091

theScrabi opened this issue Jul 11, 2018 · 7 comments
Labels

Comments

@theScrabi
Copy link

After upgrading my OS from 18.3 to mint 19 which is based on ubuntu 18.04 I could not use the open command any more giving me this message:
an not get a file descriptor referring to the console

@faho
Copy link
Member

faho commented Jul 11, 2018

Our open function simply calls a tool provided by your OS. On Linux that's "xdg-open" - which in turn will defer to a DE-specific tool.

I'd imagine you get that same error when you do xdg-open whatever?

If so, there's not much we here can do - I'd report it to Mint or your DE.

@faho faho added the question label Jul 11, 2018
@theScrabi
Copy link
Author

All right thanks, thoxdg-open worked flawlessly, open still failes:
https://asciinema.org/a/IrcT1pd1yl6Af0uOjhfpHrWGQ

however alias is a workaround :)

@faho
Copy link
Member

faho commented Jul 11, 2018

however alias is a workaround :)

Huh? That should result in basically the same thing, as alias is just syntactic sugar around functions.

I'd love to see the output of type open!

@theScrabi
Copy link
Author

theScrabi commented Jul 11, 2018

Oha thats interesting:

$ type open
open is /bin/open
$ open --help
Usage: open [OPTIONS] -- command

This utility help you to start a program on a new virtual terminal (VT).

Options:
  -c, --console=NUM   use the given VT number;
  -e, --exec          execute the command, without forking;
  -f, --force         force opening a VT without checking;
  -l, --login         make the command a login shell;
  -u, --user          figure out the owner of the current VT;
  -s, --switch        switch to the new VT;
  -w, --wait          wait for command to complete;
  -v, --verbose       print a message for each action;
  -V, --version       print program version and exit;
  -h, --help          output a brief help message.
$ open --version
open from kbd 2.0.4

Here is the package where the command was in:
https://packages.ubuntu.com/bionic/kbd

@faho
Copy link
Member

faho commented Jul 12, 2018

Ah, okay, that explains it.

We skip our open function when there's a command by that name, like macOS has. The idea there is that if the command already does the right thing, then it's superfluous.

In this case there is a command called open, but it's something quite different (and I'd expect much less used). In fact it's not even an actual binary but a compatibility symlink - see https://bugs.launchpad.net/ubuntu/+source/kbd/+bug/342581 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732796.

There are a few things we can do:

  • Nothing - always a crowd pleaser.

  • Try to see if it's this open and then still define the function.

  • Always define the function, but give xdg-open higher precedence than open.

  • Only skip the function if uname = Darwin.

The second one is harder to do than it appears - do we read the --help output? What if the tool does not support --help but launches an application for it?

The fourth is one of those things that I abhor - there are more operating systems, and they change.

The first is annoying for users on Ubuntu, Debian and Fedora (at least, I know Arch does not ship the symlink), but it might change in future - the Fedora maintainer agreed a month ago to drop it, so this might just solve itself.

So we either do nothing, or the third thing.

@theScrabi
Copy link
Author

The fourth is one of those things that I abhor - there are more operating systems, and they change.

I'd vote for the fourth solution as well.

@ridiculousfish
Copy link
Member

IMO it was a mistake for fish to ship an open function (dates from 1.x) in the first place. But "re-routing" open to xdg-open will be even more confusing. I'm fine with doing nothing here, it does seem like it will solve itself.

Closing, thanks for filing!

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

No branches or pull requests

3 participants