Skip to content

Open fails when xdg-open would launch a terminal program #10045

@genevieve-me

Description

@genevieve-me
  • fish 3.6.1
  • Linux 6.6.0-rc3 Need a history built-in #1-NixOS SMP PREEMPT_DYNAMIC
  • I tried running fish with no configuration (sh -c 'env HOME=$(mktemp -d) XDG_CONFIG_HOME= fish') and experienced the same behavior

Expected behavior

> echo $EDITOR
hx
> xdg-mime query default inode/directory 
lf.desktop
> xdg-open ~/mydirectory
(lf opens)
> open ~/mydirectory
(lf opens)
> open ~/myfile.txt
(hx opens)
> xdg-open ~/myfile.txt
(hx opens)

Current behavior

> xdg-open ~/mydirectory
(lf opens)
> open ~/mydirectory
(nothing happens and I'm still at a fish prompt)
> open ~/myfile.txt
(nothing happens and I'm still at a fish prompt)
> xdg-open ~/myfile.txt
(hx opens)

Furthermore, I tried copying the basic behavior of open.fish, and the following occurs:

> function opentest
       for i in $argv
             xdg-open $i
         end
     end
> opentest somedir/
(lf is opened correctly)

I see mention of a possible issue in the code comment here : https://github.com/fish-shell/fish-shell/blob/4ab34f2e86f91e90e732302446f1382cc122f07c/share/functions/open.fish#L33C48-L33C48 : could that be relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions