reddit / emacs

Org roam UI mode in WSL2

waterstrider123 · 2022-02-11 00:38
I am using Emacs on Window's WSL2 and I am trying to open up org roam ui mode. But it keeps saying `no usable browser found.` Is there a way to tell emacs on WSL to use the browser on windows?
Scr0f3 · 2022-02-11 07:52
I followed the recipe in [this post](https://emacsredux.com/blog/2021/12/19/wsl-specific-emacs-configuration/) on Emacs Redux and it works fine
n-i-c-l-a-s · 2022-02-11 08:52
You could add a "useable browser" by configuring the variable "browse-url-generic-program" with a line similar to this: ``` (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "/mnt/c/Program Files/Mozilla Firefox/firefox.exe") ``` If that does not work, you could always just navigate to localhost:35901 in your browser
TheSnowIsCold-46 · 2022-04-11 16:44
Oh wow, I never heard of this package but I kind of like it! Thank you for your question, it led me to a new package :). &#x200B; I use this config on WSL2 and it works well for quickly opening a browser. This ensures that the default browser of your Windows system is used (*start https://<url>* at the cmd prompt will open your Windows OS default browser). This way, WSL2 nor linux have to guess at what browser will work best on Windows, just use the one you set already as default (when (string-equal system-type "gnu/linux") (exec-path-from-shell-initialize) (setq default-directory "\~/GDrive/emacs") (when (string-match "-\[Mm\]icrosoft" operating-system-release) ;; Matching WSL1 or WSL2 environments for loading specific items ;; Changes the default browser behavior to prefer my default Windows browser ;; This speeds up opening web page time as it doesnt have to search the VM (let ((cmd-exe "/mnt/c/Windows/System32/cmd.exe") (cmd-args '("/c" "start"))) (when (file-exists-p cmd-exe) (setq browse-url-generic-program cmd-exe browse-url-generic-args cmd-args browse-url-browser-function 'browse-url-generic search-web-default-browser 'browse-url-generic)))))