obsidian-execute-code icon indicating copy to clipboard operation
obsidian-execute-code copied to clipboard

Odd request, Git Bash?

Open FenDIY opened this issue 2 years ago • 5 comments

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:

  • Git Bash (I see a window opening and executing the code, then disappearing).
  • Cygwin64 (same thing as before).

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! ^_^

FenDIY avatar Jan 29 '23 02:01 FenDIY

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.

chlohal avatar Jan 29 '23 14:01 chlohal

  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

hannesdelbeke avatar Jan 29 '23 21:01 hannesdelbeke

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.

GitTom avatar Sep 22 '23 22:09 GitTom

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

Tried, But it's not working

trinityzhub avatar Sep 18 '24 10:09 trinityzhub

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

trinityzhub avatar Sep 18 '24 10:09 trinityzhub