twibiral / obsidian-execute-code

Obsidian Plugin to execute code in a note.
MIT License
1.09k stars 66 forks source link

Odd request, Git Bash? #219

Open FenDIY opened 1 year ago

FenDIY commented 1 year ago

Hi, this is a bit of an odd request.

I have finally made obsidian-execute-code work with cling.exe (not WSL)(although I still have some errors in C (specially), and C++ (mostly solved)). But I'm trying to make Bash work on Windows (and I don't want to install/uninstall WSL again), the options I have are:

But I don't get the results on Obsidian. It doesn't return anything.

Could you please make a constructor for either one of them, or add another option to bash/shell, to be able to use them? (if you know of other alternatives for windows that work OOB with the plugin, could also be some nice options).

PS: Thank you for your hard work. Even if you cannot (or don't want to) add those changes, your work is greatly appreciated. I'm learning to code, and so far, it helps a lot! ^_^

chlohal commented 1 year ago

Hi! What path are you using to Git Bash?

I've had this issue in the past-- there are actually two executables for git bash. One, bash.exe, is what you want; the other one is just the visual terminal.

hannesdelbeke commented 1 year ago
  1. in the plugin settings, for Shell language set the Shell path to bash
  2. add your git installation folder containing bash.exe to the PATH env var in your system env variables.

it should work now

GitTom commented 1 year ago

An alternative to adding the Git bash folder to your PATH is to specify it in the plugins settings. So, I set the 'shell path' setting on on a Windows 10 machine to "C:/Progra~1/Git/bin/bash.exe" and this worked: my shell code blocks are executed by Git bash.

trinityzhub commented 2 weeks ago

2. git installation folder containing bash.exe to the PATH env var in your system env variables.

Tried, But it's not working

trinityzhub commented 2 weeks ago

An alternative to adding the Git bash folder to your PATH is to specify it in the plugins settings. So, I set the 'shell path' setting on on a Windows 10 machine to "C:/Progra~1/Git/bin/bash.exe" and this worked: my shell code blocks are executed by Git bash.

It working. thanks Bro