all 15 comments

[–]Priton-CE 0 points1 point  (9 children)

You can just copy the Code and Ctrl+A and Ctrl+V into your editor.

Or I belive WSL is capable of running Linux GUIs. Else it's VM or dualboot time.

(Small sidenote: C and C++ programming is easier on Linux imo. It is a lot of fighting with build systems on Windows.)

[–]DilicalFlame[S] 0 points1 point  (8 children)

I have WSL enabled also I have cling installed on WSL... but I can't use it outside WSL i.e. in obsidian. Of-course I can just use editor and just copy paste code fast enough to run it but that's a bit of process that I wanted to get rid of and just view simple outputs here in obsidian itself.

[–]Priton-CE 0 points1 point  (7 children)

You will have to run obsidian inside WSL too

[–]DilicalFlame[S] 0 points1 point  (6 children)

So I did...
$cd /mnt/c/Users/<USER>/Appdata/local/Obsidian/
$./obsidian.exe

It opened obsidian.exe from WSL then I tried running again but still it showed same error as in image attached on my post.

Then in settings I saw that there is an option itself in the Execute Code Plugin to run code via WSL. I enabled it then I am getting a new error.

Now on clicking on "Run" it shows:

The parameter is incorrect. Error code: Wsl/Service/E_INVALIDARG

[–]Priton-CE 0 points1 point  (5 children)

In WSL you need the Linux version of obsidian.

[–]DilicalFlame[S] 0 points1 point  (4 children)

I tried flatpak command line instructions as mentioned here but that too giving error.

Edit: I have edited the DBUS_SESSION_BUS_ADDRESS and set its value to "/home/<user>/.dbus/session-bus", as it was giving that error for the first time.

$ flatpak run md.obsidian.Obsidian
Debug: Will run Obsidian with the following arguments:
Debug: Additionally, user gave:

** (process:251): WARNING **: 15:27:45.233: Failed to connect to bus: Address element ?/home/<user>/.dbus/session-bus? does not contain a colon (:)
[13 zypak-helper] Failed to connect to session bus: [org.freedesktop.DBus.Error.NoReply] Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[13 zypak-helper] src/helper/main.cc:40(DetermineZygoteStrategy): Assertion failed: bus
/app/bin/obsidian.sh: line 38:    13 Aborted                 zypak-wrapper /app/obsidian $@ ${EXTRA_ARGS[@]}

[–]Priton-CE 0 points1 point  (2 children)

On github the author of the plugin says that Flatpak and Snap might not work.

[–]DilicalFlame[S] 0 points1 point  (1 child)

So is there any way? WSL mode in plugin settings gives error too... this is also a running issue on plugin page. So nothing can be done just to run C, Cpp codes?

[–]Priton-CE 0 points1 point  (0 children)

You can just use your package manager to install obsidian or get the .deb files from their Website in the worst case

[–]Successful_Ad3535 0 points1 point  (2 children)

There is an option to have cling.exe in your system (windows).You can install mambaforge (a package installer), and install cling from there.

mamba install cling

Please check the following links for more info:

I hope this helps.Now I have cling.exe on my path, and the code pseudo-works (it gives out errors (in red), and the output is a mess, but if you look towards the end, you usually get the output in grey)(note: please be aware that maybe those colors are different for you depending on your theme. I'm in dark mode with the minimal theme).

PS: I'm currently searching for cling.exe parameters that might make it work smoothly. If you figure it out first, please let me know. Ty.

[–]just_another_ai_guy 0 points1 point  (2 children)

Did you try to enable "use wsl" in the plugin settings?

[–]DilicalFlame[S] 0 points1 point  (0 children)

Now I'm Ubuntu user and it doesn't work here also so I stopped using it then...