xdg-open on debian 9 fails to open browser

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
2












I decided to try lxdm (was using fluxbox and xfce), and discovered that for many programs the url handler was failing, producing this error message;
error message



Quite strange as you can see, it's prepending the user directory to the url.
The example here is from telegram, but it happens in discord, as well as when executing from the command line; xdg-open https://www.google.com produces a similar error.
xdg-settings get default-web-browser output's firefox.desktop which works as a link in both xfce and lxdm.
More information; I ran bash -x on it and...



$ bash -x /usr/bin/xdg-open http://www.google.com
+ check_common_commands http://www.google.com
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' 0 -gt 0 ']'
+ '[' -z '' ']'
+ unset XDG_UTILS_DEBUG_LEVEL
+ '[' 0 -lt 1 ']'
+ xdg_redirect_output=' > /dev/null 2> /dev/null'
+ '[' xhttp://www.google.com '!=' x ']'
+ url=
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' -n '' ']'
+ url=http://www.google.com
+ '[' 0 -gt 0 ']'
+ '[' -z http://www.google.com ']'
+ detectDE
+ unset GREP_OPTIONS
+ '[' -n LXDE ']'
+ case "$XDG_CURRENT_DESKTOP" in
+ DE=lxde
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = xgnome ']'
+ '[' -f /run/user/1000/flatpak-info ']'
+ '[' xlxde = x ']'
+ DEBUG 2 'Selected DE lxde'
+ '[' -z '' ']'
+ return 0
+ case "$BROWSER" in
+ case "$DE" in
+ open_lxde http://www.google.com
+ pcmanfm --help -a is_file_url_or_path http://www.google.com
++ file_url_to_path http://www.google.com
++ local file=http://www.google.com
++ echo http://www.google.com
++ grep -q '^file:///'
++ echo http://www.google.com
+ local file=http://www.google.com
+ echo http://www.google.com
+ grep -q '^/'
++ pwd
+ file=/home/nesmerrill/.local/share/applications/http://www.google.com
+ pcmanfm /home/nesmerrill/.local/share/applications/http://www.google.com
+ '[' 0 -eq 0 ']'
+ exit_success
+ '[' 0 -gt 0 ']'
+ exit 0


The important part seems to be pcmanfm --help -a is_file_url_or_path http://www.google.com but, that command if that's how it was used, doesn't seem to do much of anything?



$ pcmanfm --help -a is_file_url_or_path http://www.google.com
Usage:
pcmanfm [OPTION…] [FILE1, FILE2,...]

Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options

Application Options:
-p, --profile=PROFILE Name of configuration profile
-d, --daemon-mode Run PCManFM as a daemon
--no-desktop No function. Just to be compatible with nautilus
--desktop Launch desktop manager
--desktop-off Turn off desktop manager if it's running
--desktop-pref Open desktop preference dialog
--one-screen Use --desktop option only for one screen
-w, --set-wallpaper=FILE Set desktop wallpaper from image FILE
--wallpaper-mode=MODE Set mode of desktop wallpaper. MODE=(color|stretch|fit|crop|center|tile|screen)
--show-pref=N Open Preferences dialog on the page N
-n, --new-win Open new window
-f, --find-files Open a Find Files window
--role=ROLE Window role for usage by window manager
--display=DISPLAY X display to use









share|improve this question























  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Yeah that was my judgement too. But the method to test if it's a file or url seems to be passing it off to PCManFM... which is just bizarre. For now, I just deleted that part of the script and it now opens urls... but next time xdg updates? poof.
    – Evil Spork
    Jun 17 at 1:49











  • Point was, did you look at the way the programmes are registered in your DE? xdg-open behaves differently depending what it is told to expect......
    – bu5hman
    Jun 18 at 19:56










  • Yes, I looked into it, and it was calling PCManFM on LXDE, as I said in the post. Which is a very strange call for a url. Deleting that part of the function Open_LXDE() allowed xdg to function on urls. Which is a hack, and doesn't really solve the root problem. Now I can't open file:// with xdg!
    – Evil Spork
    Jun 20 at 10:43















up vote
2
down vote

favorite
2












I decided to try lxdm (was using fluxbox and xfce), and discovered that for many programs the url handler was failing, producing this error message;
error message



Quite strange as you can see, it's prepending the user directory to the url.
The example here is from telegram, but it happens in discord, as well as when executing from the command line; xdg-open https://www.google.com produces a similar error.
xdg-settings get default-web-browser output's firefox.desktop which works as a link in both xfce and lxdm.
More information; I ran bash -x on it and...



$ bash -x /usr/bin/xdg-open http://www.google.com
+ check_common_commands http://www.google.com
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' 0 -gt 0 ']'
+ '[' -z '' ']'
+ unset XDG_UTILS_DEBUG_LEVEL
+ '[' 0 -lt 1 ']'
+ xdg_redirect_output=' > /dev/null 2> /dev/null'
+ '[' xhttp://www.google.com '!=' x ']'
+ url=
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' -n '' ']'
+ url=http://www.google.com
+ '[' 0 -gt 0 ']'
+ '[' -z http://www.google.com ']'
+ detectDE
+ unset GREP_OPTIONS
+ '[' -n LXDE ']'
+ case "$XDG_CURRENT_DESKTOP" in
+ DE=lxde
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = xgnome ']'
+ '[' -f /run/user/1000/flatpak-info ']'
+ '[' xlxde = x ']'
+ DEBUG 2 'Selected DE lxde'
+ '[' -z '' ']'
+ return 0
+ case "$BROWSER" in
+ case "$DE" in
+ open_lxde http://www.google.com
+ pcmanfm --help -a is_file_url_or_path http://www.google.com
++ file_url_to_path http://www.google.com
++ local file=http://www.google.com
++ echo http://www.google.com
++ grep -q '^file:///'
++ echo http://www.google.com
+ local file=http://www.google.com
+ echo http://www.google.com
+ grep -q '^/'
++ pwd
+ file=/home/nesmerrill/.local/share/applications/http://www.google.com
+ pcmanfm /home/nesmerrill/.local/share/applications/http://www.google.com
+ '[' 0 -eq 0 ']'
+ exit_success
+ '[' 0 -gt 0 ']'
+ exit 0


The important part seems to be pcmanfm --help -a is_file_url_or_path http://www.google.com but, that command if that's how it was used, doesn't seem to do much of anything?



$ pcmanfm --help -a is_file_url_or_path http://www.google.com
Usage:
pcmanfm [OPTION…] [FILE1, FILE2,...]

Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options

Application Options:
-p, --profile=PROFILE Name of configuration profile
-d, --daemon-mode Run PCManFM as a daemon
--no-desktop No function. Just to be compatible with nautilus
--desktop Launch desktop manager
--desktop-off Turn off desktop manager if it's running
--desktop-pref Open desktop preference dialog
--one-screen Use --desktop option only for one screen
-w, --set-wallpaper=FILE Set desktop wallpaper from image FILE
--wallpaper-mode=MODE Set mode of desktop wallpaper. MODE=(color|stretch|fit|crop|center|tile|screen)
--show-pref=N Open Preferences dialog on the page N
-n, --new-win Open new window
-f, --find-files Open a Find Files window
--role=ROLE Window role for usage by window manager
--display=DISPLAY X display to use









share|improve this question























  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Yeah that was my judgement too. But the method to test if it's a file or url seems to be passing it off to PCManFM... which is just bizarre. For now, I just deleted that part of the script and it now opens urls... but next time xdg updates? poof.
    – Evil Spork
    Jun 17 at 1:49











  • Point was, did you look at the way the programmes are registered in your DE? xdg-open behaves differently depending what it is told to expect......
    – bu5hman
    Jun 18 at 19:56










  • Yes, I looked into it, and it was calling PCManFM on LXDE, as I said in the post. Which is a very strange call for a url. Deleting that part of the function Open_LXDE() allowed xdg to function on urls. Which is a hack, and doesn't really solve the root problem. Now I can't open file:// with xdg!
    – Evil Spork
    Jun 20 at 10:43













up vote
2
down vote

favorite
2









up vote
2
down vote

favorite
2






2





I decided to try lxdm (was using fluxbox and xfce), and discovered that for many programs the url handler was failing, producing this error message;
error message



Quite strange as you can see, it's prepending the user directory to the url.
The example here is from telegram, but it happens in discord, as well as when executing from the command line; xdg-open https://www.google.com produces a similar error.
xdg-settings get default-web-browser output's firefox.desktop which works as a link in both xfce and lxdm.
More information; I ran bash -x on it and...



$ bash -x /usr/bin/xdg-open http://www.google.com
+ check_common_commands http://www.google.com
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' 0 -gt 0 ']'
+ '[' -z '' ']'
+ unset XDG_UTILS_DEBUG_LEVEL
+ '[' 0 -lt 1 ']'
+ xdg_redirect_output=' > /dev/null 2> /dev/null'
+ '[' xhttp://www.google.com '!=' x ']'
+ url=
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' -n '' ']'
+ url=http://www.google.com
+ '[' 0 -gt 0 ']'
+ '[' -z http://www.google.com ']'
+ detectDE
+ unset GREP_OPTIONS
+ '[' -n LXDE ']'
+ case "$XDG_CURRENT_DESKTOP" in
+ DE=lxde
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = xgnome ']'
+ '[' -f /run/user/1000/flatpak-info ']'
+ '[' xlxde = x ']'
+ DEBUG 2 'Selected DE lxde'
+ '[' -z '' ']'
+ return 0
+ case "$BROWSER" in
+ case "$DE" in
+ open_lxde http://www.google.com
+ pcmanfm --help -a is_file_url_or_path http://www.google.com
++ file_url_to_path http://www.google.com
++ local file=http://www.google.com
++ echo http://www.google.com
++ grep -q '^file:///'
++ echo http://www.google.com
+ local file=http://www.google.com
+ echo http://www.google.com
+ grep -q '^/'
++ pwd
+ file=/home/nesmerrill/.local/share/applications/http://www.google.com
+ pcmanfm /home/nesmerrill/.local/share/applications/http://www.google.com
+ '[' 0 -eq 0 ']'
+ exit_success
+ '[' 0 -gt 0 ']'
+ exit 0


The important part seems to be pcmanfm --help -a is_file_url_or_path http://www.google.com but, that command if that's how it was used, doesn't seem to do much of anything?



$ pcmanfm --help -a is_file_url_or_path http://www.google.com
Usage:
pcmanfm [OPTION…] [FILE1, FILE2,...]

Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options

Application Options:
-p, --profile=PROFILE Name of configuration profile
-d, --daemon-mode Run PCManFM as a daemon
--no-desktop No function. Just to be compatible with nautilus
--desktop Launch desktop manager
--desktop-off Turn off desktop manager if it's running
--desktop-pref Open desktop preference dialog
--one-screen Use --desktop option only for one screen
-w, --set-wallpaper=FILE Set desktop wallpaper from image FILE
--wallpaper-mode=MODE Set mode of desktop wallpaper. MODE=(color|stretch|fit|crop|center|tile|screen)
--show-pref=N Open Preferences dialog on the page N
-n, --new-win Open new window
-f, --find-files Open a Find Files window
--role=ROLE Window role for usage by window manager
--display=DISPLAY X display to use









share|improve this question















I decided to try lxdm (was using fluxbox and xfce), and discovered that for many programs the url handler was failing, producing this error message;
error message



Quite strange as you can see, it's prepending the user directory to the url.
The example here is from telegram, but it happens in discord, as well as when executing from the command line; xdg-open https://www.google.com produces a similar error.
xdg-settings get default-web-browser output's firefox.desktop which works as a link in both xfce and lxdm.
More information; I ran bash -x on it and...



$ bash -x /usr/bin/xdg-open http://www.google.com
+ check_common_commands http://www.google.com
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' 0 -gt 0 ']'
+ '[' -z '' ']'
+ unset XDG_UTILS_DEBUG_LEVEL
+ '[' 0 -lt 1 ']'
+ xdg_redirect_output=' > /dev/null 2> /dev/null'
+ '[' xhttp://www.google.com '!=' x ']'
+ url=
+ '[' 1 -gt 0 ']'
+ parm=http://www.google.com
+ shift
+ case "$parm" in
+ '[' -n '' ']'
+ url=http://www.google.com
+ '[' 0 -gt 0 ']'
+ '[' -z http://www.google.com ']'
+ detectDE
+ unset GREP_OPTIONS
+ '[' -n LXDE ']'
+ case "$XDG_CURRENT_DESKTOP" in
+ DE=lxde
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = x ']'
+ '[' xlxde = xgnome ']'
+ '[' -f /run/user/1000/flatpak-info ']'
+ '[' xlxde = x ']'
+ DEBUG 2 'Selected DE lxde'
+ '[' -z '' ']'
+ return 0
+ case "$BROWSER" in
+ case "$DE" in
+ open_lxde http://www.google.com
+ pcmanfm --help -a is_file_url_or_path http://www.google.com
++ file_url_to_path http://www.google.com
++ local file=http://www.google.com
++ echo http://www.google.com
++ grep -q '^file:///'
++ echo http://www.google.com
+ local file=http://www.google.com
+ echo http://www.google.com
+ grep -q '^/'
++ pwd
+ file=/home/nesmerrill/.local/share/applications/http://www.google.com
+ pcmanfm /home/nesmerrill/.local/share/applications/http://www.google.com
+ '[' 0 -eq 0 ']'
+ exit_success
+ '[' 0 -gt 0 ']'
+ exit 0


The important part seems to be pcmanfm --help -a is_file_url_or_path http://www.google.com but, that command if that's how it was used, doesn't seem to do much of anything?



$ pcmanfm --help -a is_file_url_or_path http://www.google.com
Usage:
pcmanfm [OPTION…] [FILE1, FILE2,...]

Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options

Application Options:
-p, --profile=PROFILE Name of configuration profile
-d, --daemon-mode Run PCManFM as a daemon
--no-desktop No function. Just to be compatible with nautilus
--desktop Launch desktop manager
--desktop-off Turn off desktop manager if it's running
--desktop-pref Open desktop preference dialog
--one-screen Use --desktop option only for one screen
-w, --set-wallpaper=FILE Set desktop wallpaper from image FILE
--wallpaper-mode=MODE Set mode of desktop wallpaper. MODE=(color|stretch|fit|crop|center|tile|screen)
--show-pref=N Open Preferences dialog on the page N
-n, --new-win Open new window
-f, --find-files Open a Find Files window
--role=ROLE Window role for usage by window manager
--display=DISPLAY X display to use






debian url xdg xdg-open lxdm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 16 at 21:45

























asked Jun 16 at 19:37









Evil Spork

1114




1114











  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Yeah that was my judgement too. But the method to test if it's a file or url seems to be passing it off to PCManFM... which is just bizarre. For now, I just deleted that part of the script and it now opens urls... but next time xdg updates? poof.
    – Evil Spork
    Jun 17 at 1:49











  • Point was, did you look at the way the programmes are registered in your DE? xdg-open behaves differently depending what it is told to expect......
    – bu5hman
    Jun 18 at 19:56










  • Yes, I looked into it, and it was calling PCManFM on LXDE, as I said in the post. Which is a very strange call for a url. Deleting that part of the function Open_LXDE() allowed xdg to function on urls. Which is a hack, and doesn't really solve the root problem. Now I can't open file:// with xdg!
    – Evil Spork
    Jun 20 at 10:43

















  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
    – bu5hman
    Jun 16 at 22:44










  • Yeah that was my judgement too. But the method to test if it's a file or url seems to be passing it off to PCManFM... which is just bizarre. For now, I just deleted that part of the script and it now opens urls... but next time xdg updates? poof.
    – Evil Spork
    Jun 17 at 1:49











  • Point was, did you look at the way the programmes are registered in your DE? xdg-open behaves differently depending what it is told to expect......
    – bu5hman
    Jun 18 at 19:56










  • Yes, I looked into it, and it was calling PCManFM on LXDE, as I said in the post. Which is a very strange call for a url. Deleting that part of the function Open_LXDE() allowed xdg to function on urls. Which is a hack, and doesn't really solve the root problem. Now I can't open file:// with xdg!
    – Evil Spork
    Jun 20 at 10:43
















Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
– bu5hman
Jun 16 at 22:44




Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
– bu5hman
Jun 16 at 22:44












Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
– bu5hman
Jun 16 at 22:44




Had something similar here, In my case it was user error. Your example works fine on my machine though. Judging from the output, your machine thinks it has a file rather than a url.........
– bu5hman
Jun 16 at 22:44












Yeah that was my judgement too. But the method to test if it's a file or url seems to be passing it off to PCManFM... which is just bizarre. For now, I just deleted that part of the script and it now opens urls... but next time xdg updates? poof.
– Evil Spork
Jun 17 at 1:49





Yeah that was my judgement too. But the method to test if it's a file or url seems to be passing it off to PCManFM... which is just bizarre. For now, I just deleted that part of the script and it now opens urls... but next time xdg updates? poof.
– Evil Spork
Jun 17 at 1:49













Point was, did you look at the way the programmes are registered in your DE? xdg-open behaves differently depending what it is told to expect......
– bu5hman
Jun 18 at 19:56




Point was, did you look at the way the programmes are registered in your DE? xdg-open behaves differently depending what it is told to expect......
– bu5hman
Jun 18 at 19:56












Yes, I looked into it, and it was calling PCManFM on LXDE, as I said in the post. Which is a very strange call for a url. Deleting that part of the function Open_LXDE() allowed xdg to function on urls. Which is a hack, and doesn't really solve the root problem. Now I can't open file:// with xdg!
– Evil Spork
Jun 20 at 10:43





Yes, I looked into it, and it was calling PCManFM on LXDE, as I said in the post. Which is a very strange call for a url. Deleting that part of the function Open_LXDE() allowed xdg to function on urls. Which is a hack, and doesn't really solve the root problem. Now I can't open file:// with xdg!
– Evil Spork
Jun 20 at 10:43











2 Answers
2






active

oldest

votes

















up vote
2
down vote













This for Debian 10 (buster), LXDE and xdg-utils 1.1.3-1 too.
There is a typo in the xdg-open script and the solution is as follows:



 --- /usr/bin/xdg-open 2018-05-20 00:18:48.000000000 +0200
+++ /home/klaumi/bin/xdg-open 2018-09-13 15:15:51.630704599 +0200
@@ -928,7 +928,7 @@
{

# pcmanfm only knows how to handle file:// urls and filepaths, it seems.
- if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then
+ if pcmanfm --help >/dev/null 2>$1 -a is_file_url_or_path "$1"; then
local file="$(file_url_to_path "$1")"

# handle relative paths


(Note that & has to be replaced with $)






share|improve this answer


















  • 1




    Please provide reference.
    – user88036
    Sep 13 at 13:39

















up vote
1
down vote













Confirmed for Debian 10 (buster), LXDE, xdg-utils 1.1.3-1. Looks like a bug? One option that doesn't require editing /usr/bin/xdg-open:



  • You can ask xdg-open to use a different desktop environment's handler (ref 1):
    XDG_CURRENT_DESKTOP=gnome xdg-open https://www.google.com







share|improve this answer




















  • I have the same problem in openSUSE with LXDE. Your solution doesn't work, unfortunately.
    – rominf
    Nov 28 at 15:31










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f450200%2fxdg-open-on-debian-9-fails-to-open-browser%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













This for Debian 10 (buster), LXDE and xdg-utils 1.1.3-1 too.
There is a typo in the xdg-open script and the solution is as follows:



 --- /usr/bin/xdg-open 2018-05-20 00:18:48.000000000 +0200
+++ /home/klaumi/bin/xdg-open 2018-09-13 15:15:51.630704599 +0200
@@ -928,7 +928,7 @@
{

# pcmanfm only knows how to handle file:// urls and filepaths, it seems.
- if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then
+ if pcmanfm --help >/dev/null 2>$1 -a is_file_url_or_path "$1"; then
local file="$(file_url_to_path "$1")"

# handle relative paths


(Note that & has to be replaced with $)






share|improve this answer


















  • 1




    Please provide reference.
    – user88036
    Sep 13 at 13:39














up vote
2
down vote













This for Debian 10 (buster), LXDE and xdg-utils 1.1.3-1 too.
There is a typo in the xdg-open script and the solution is as follows:



 --- /usr/bin/xdg-open 2018-05-20 00:18:48.000000000 +0200
+++ /home/klaumi/bin/xdg-open 2018-09-13 15:15:51.630704599 +0200
@@ -928,7 +928,7 @@
{

# pcmanfm only knows how to handle file:// urls and filepaths, it seems.
- if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then
+ if pcmanfm --help >/dev/null 2>$1 -a is_file_url_or_path "$1"; then
local file="$(file_url_to_path "$1")"

# handle relative paths


(Note that & has to be replaced with $)






share|improve this answer


















  • 1




    Please provide reference.
    – user88036
    Sep 13 at 13:39












up vote
2
down vote










up vote
2
down vote









This for Debian 10 (buster), LXDE and xdg-utils 1.1.3-1 too.
There is a typo in the xdg-open script and the solution is as follows:



 --- /usr/bin/xdg-open 2018-05-20 00:18:48.000000000 +0200
+++ /home/klaumi/bin/xdg-open 2018-09-13 15:15:51.630704599 +0200
@@ -928,7 +928,7 @@
{

# pcmanfm only knows how to handle file:// urls and filepaths, it seems.
- if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then
+ if pcmanfm --help >/dev/null 2>$1 -a is_file_url_or_path "$1"; then
local file="$(file_url_to_path "$1")"

# handle relative paths


(Note that & has to be replaced with $)






share|improve this answer














This for Debian 10 (buster), LXDE and xdg-utils 1.1.3-1 too.
There is a typo in the xdg-open script and the solution is as follows:



 --- /usr/bin/xdg-open 2018-05-20 00:18:48.000000000 +0200
+++ /home/klaumi/bin/xdg-open 2018-09-13 15:15:51.630704599 +0200
@@ -928,7 +928,7 @@
{

# pcmanfm only knows how to handle file:// urls and filepaths, it seems.
- if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then
+ if pcmanfm --help >/dev/null 2>$1 -a is_file_url_or_path "$1"; then
local file="$(file_url_to_path "$1")"

# handle relative paths


(Note that & has to be replaced with $)







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 28 at 16:06









sam

13.3k31426




13.3k31426










answered Sep 13 at 13:31









user310685

292




292







  • 1




    Please provide reference.
    – user88036
    Sep 13 at 13:39












  • 1




    Please provide reference.
    – user88036
    Sep 13 at 13:39







1




1




Please provide reference.
– user88036
Sep 13 at 13:39




Please provide reference.
– user88036
Sep 13 at 13:39












up vote
1
down vote













Confirmed for Debian 10 (buster), LXDE, xdg-utils 1.1.3-1. Looks like a bug? One option that doesn't require editing /usr/bin/xdg-open:



  • You can ask xdg-open to use a different desktop environment's handler (ref 1):
    XDG_CURRENT_DESKTOP=gnome xdg-open https://www.google.com







share|improve this answer




















  • I have the same problem in openSUSE with LXDE. Your solution doesn't work, unfortunately.
    – rominf
    Nov 28 at 15:31














up vote
1
down vote













Confirmed for Debian 10 (buster), LXDE, xdg-utils 1.1.3-1. Looks like a bug? One option that doesn't require editing /usr/bin/xdg-open:



  • You can ask xdg-open to use a different desktop environment's handler (ref 1):
    XDG_CURRENT_DESKTOP=gnome xdg-open https://www.google.com







share|improve this answer




















  • I have the same problem in openSUSE with LXDE. Your solution doesn't work, unfortunately.
    – rominf
    Nov 28 at 15:31












up vote
1
down vote










up vote
1
down vote









Confirmed for Debian 10 (buster), LXDE, xdg-utils 1.1.3-1. Looks like a bug? One option that doesn't require editing /usr/bin/xdg-open:



  • You can ask xdg-open to use a different desktop environment's handler (ref 1):
    XDG_CURRENT_DESKTOP=gnome xdg-open https://www.google.com







share|improve this answer












Confirmed for Debian 10 (buster), LXDE, xdg-utils 1.1.3-1. Looks like a bug? One option that doesn't require editing /usr/bin/xdg-open:



  • You can ask xdg-open to use a different desktop environment's handler (ref 1):
    XDG_CURRENT_DESKTOP=gnome xdg-open https://www.google.com








share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 22 at 2:33









helmingstay

13913




13913











  • I have the same problem in openSUSE with LXDE. Your solution doesn't work, unfortunately.
    – rominf
    Nov 28 at 15:31
















  • I have the same problem in openSUSE with LXDE. Your solution doesn't work, unfortunately.
    – rominf
    Nov 28 at 15:31















I have the same problem in openSUSE with LXDE. Your solution doesn't work, unfortunately.
– rominf
Nov 28 at 15:31




I have the same problem in openSUSE with LXDE. Your solution doesn't work, unfortunately.
– rominf
Nov 28 at 15:31

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f450200%2fxdg-open-on-debian-9-fails-to-open-browser%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?