Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 615  / 2 Years ago, mon, april 18, 2022, 4:56:38

I have a problem when some shell command is trying to launch my browser. Example below with browse command, but same with jupyter notebook. It looks like the target is opened in VSCode instead.


I'm running Ubuntu 20.04, with zsh, in a pyenv virtual environment.


Thanks!


~ browse askubuntu.com
command= "code" args= ("code", "http://askubuntu.com")
~ Copying QUrl("http://askubuntu.com/") to QUrl("file:///home/username/.cache/kioexec/krun/8292_0/unnamed")
Telling kioexecd to watch path "/home/username/.cache/kioexec/krun/8292_0/unnamed" dest "http://askubuntu.com/"
All files downloaded, will call slotRunApp shortly
EXEC "/snap/bin/code /home/username/.cache/kioexec/krun/8292_0/unnamed"
EXEC done


... then VSCode opens the target as a html file.



  • EDIT: Same error when I run xdg-open 'http://askubuntu.com'



  • EDIT: xdg-settings get default-web-browser yields code-2.desktop



  • EDIT: if I do xdg-settings set default-web-browser firefox.desktop, no error raised but it doesn't actually change the value (stays as code-2.desktop)



  • EDIT: $BROWSER askubuntu.com works perfectly fine



  • SOLVED: Thanks to @Koen I went to System settings/Applications/Default Applications (I'm on KDE) --> Web Browser --> Open http and https URLs "in the following application: Firefox" instead of "in an application based on the contents of the URL"




More From » firefox

 Answers
6

xdg-settings fails silently - an echo $? can show you that return code is not 0 when it failed


return codes:



1 Error in command line syntax.

2 One of the files passed on the command line did not exist.

3 A required tool could not be found.

4 The action failed.



browse is a link to xdg-open - so you need to supply an url to open the default browser


the default browser can also be set via gui tools



  • gnome: gnome-control-center - default applications - web

  • KDE: System settings/Applications/Default Applications --> Web Browser --> Open http and https URLs "in the following application: Firefox"


[#899] Tuesday, April 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
defendle

Total Points: 219
Total Questions: 131
Total Answers: 112

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
defendle questions
Mon, May 10, 21, 03:46, 3 Years ago
Mon, Dec 5, 22, 07:16, 1 Year ago
Tue, Jun 21, 22, 13:49, 2 Years ago
;