8000 Can't specify git bash as terminal when running rstudio through rig · Issue #268 · r-lib/rig · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Can't specify git bash as terminal when running rstudio through rig #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms o 8000 f service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wzbillings opened this issue Feb 10, 2025 · 6 comments
Open
Labels
bug an unexpected problem or unintended behavior windows Specific to Windows

Comments

@wzbillings
Copy link

When I launch RStudio manually, I can set "Git Bash" as the option for the terminal. I'm talking about the option under "Global Options" -> "Terminal" in left-hand menu -> "New terminals open with" dropdown menu.

When I launch RStudio via rig rstudio, the option for Git Bash isn't present in the list of options for opening a terminal.

If I launch RStudio via rig rstudio and I set the option for the terminal to "Custom" with the path to my global git bash path, RStudio will open a terminal in another window -- I'd like to have it embedded as usual if possible.

I see from the console output when running rig rstudio that it runs cmd.exe /c start /b rstudio. Is the problem that Git Bash isn't in the path when this happens? I'm used to bash and not that familiar with cmd so I don't know if that's the same problem, or how to fix it. I tried searching through the other issues in this repo and online but didn't find anyone else with the same issue. However, if I check in Powershell ([Environment]::GetEnvironmentVariable("PATH")), the path to my git bash exe is in there, so I'm not sure why RStudio can't find Git Bash when I open it through Rig.

I'm fairly sure that the Git installation is not the problem -- I have Git/Git Bash installed in the usual Program Files location, and I can use git through any of the terminals that open in RStudio.

I'm using rig 0.7.0, R 4.4.2 (installed through rig), and RStudio 2024.12.0 Build 467 (installed manually), if any of that is relevant.

Thanks in advance!!

@gaborcsardi
Copy link
Member

Have you tried putting git bash on the PATH?

@wzbillings
Copy link
Author

Yes, I added it to the windows machine-level path in Powershell. when I check the path in cmd, it shows up.

@gaborcsardi
Copy link
Member

rig does not use powershell to start RStudio, so try setting the PATH in your user's config, or the global config.

@wzbillings
Copy link
Author

I'm not sure I understand you. The exe for Git Bash is already in my bash PATH. The exe for Git Bash is also in the PATH for cmd, which Rig does use (cmd and powershell share windows environment variables).

But RStudio still can't "see" Git Bash as an option when I launch it through rig rstudio in my bash terminal. I'm not sure where else I should be adding git bash to the PATH.

@gaborcsardi
Copy link
Member

I meant like this: https://www.computerhope.com/issues/ch000549.htm#windows11

(You'll have to restart the shell after this, probably.)

What does R (in Rstudio started with rig) give you for

Sys.which("bash")

?

@wzbillings
Copy link
Author
wzbillings commented Feb 12, 2025

I meant like this: https://www.computerhope.com/issues/ch000549.htm#windows11

(You'll have to restart the shell after this, probably.)

Yep when I check the GUI it is set in there. Setting the environment variable in powershell does the same thing, but I double checked just in case. The path to git bash is in both my local and system environment variables.

What does R (in Rstudio started with rig) give you for

Sys.which("bash")

?

It returns "C:\\WINDOWS\\SYSTEM32\\bash.exe", which is the WSL bash terminal (I can select this as an option in RStudio's dropdown menu regardless of if I start RStudio via Rig or manually).

If I check Sys.which("git-bash") it returns "C:\\PROGRA~1\\Git\\git-bash.exe", which is correct. I added this literally to the PATH with the abbreviation to see what happened, and (unsurprisingly) it didn't fix the problem, cause the abbreviation resolves to the correct file path. I get the exact same results when I run those options in RStudio started without using Rig.

It's strange to me that RStudio is able to find the git bash executable when I start it with Rig and the option just isn't there in the dropdown menu I'm looking at. (But still, if I start RStudio without Rig, it is an option.)

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Feb 12, 2025
@gaborcsardi gaborcsardi added the windows Specific to Windows label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior windows Specific to Windows
Projects
None yet
Development

No branches or pull requests

2 participants
0