rig icon indicating copy to clipboard operation
rig copied to clipboard

Problems in Windows cmd (?)

Open gaborcsardi opened this issue 1 year ago • 5 comments

Cf https://github.com/r-lib/rig/issues/179#issuecomment-1703035665

HI. Thank you . I don0t know if it fits for an issue, but I'm having trouble to have different R versions in different RStudio windows. When I use rig rstudio 4.1.2, then when I use rig rstudio 4.2.3 it does not open another Rstudio with the rstudio 4.2.3: it simply does nothing afterwards

PS C:\WINDOWS\system32> rig rstudio 4.0.2
rig : [0m[34m[INFO] [0mRunning cmd.exe /c start /b rstudio /d C:\WINDOWS\system32
En línea: 1 Carácter: 1
+ rig rstudio 4.0.2
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ([0m[34m[INFO]...INDOWS\system32:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

gaborcsardi avatar Sep 01 '23 18:09 gaborcsardi

@FONDECYTACC It seems like the ANSI sequences are not handled properly by your terminal. Which terminal are you using? Try setting the NO_COLOR=1 environment variable:

In cmd.exe:

set NO_COLOR=1
rig rstudio 4.0.2

In powershell:

$env:NO_COLOR="1"
rig rstudio 4.0.2

gaborcsardi avatar Sep 01 '23 19:09 gaborcsardi

Hi,

I tried opening from cmd.exe and I got the same results. Once 4.0.2 opens, 4.1.2 does not. The same happens if I do it viceversa image

Once I open an RStudio session in Windows 10, I cannot display another one. I must set "rig default 4.1.2" and then click the Rstudio symbol to open another session with a different R version. Even if I try to run "rig rstudio 4.1.2" twice, the expected second window does not display, no matter if it is in powershell or cmd

image

RStudio 2023.06.2+561 "Mountain Hydrangea" Release (de44a3118f7963972e24a78b7a1ad48b4be8a217, 2023-08-25) for windows Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.06.2+561 Chrome/110.0.5481.208 Electron/23.3.0 Safari/537.36

FONDECYTACC avatar Sep 02 '23 00:09 FONDECYTACC

OK, I see this now as well. It is because rig now adds /d to the command line, to keep the working directory, but this somehow makes RStudio not to start a new instance. If you call the command manually and omit the /d flag, then it works:

cmd.exe /c start /b rstudio

I don't know if there is a way to both keep the working directory and also start a multiple instances, but the current behavior is definitely worse than the previous one, so I consider this a bug.

gaborcsardi avatar Sep 02 '23 07:09 gaborcsardi

Also if I play "rig rstudio 4.1.2" and then "cmd.exe /c start /b rstudio" in cmd, i get the r version that i wanted

image

AGSCL avatar Sep 10 '23 13:09 AGSCL

@AGSCL Yeah, rig rstudio 4.1.2 changed the default to 4.1.2 for RStudio, so if you then omit the /d then it'll work. /d is causing the issue here.

gaborcsardi avatar Sep 10 '23 14:09 gaborcsardi

This should be solved by the recent rig rstudio changes. Will be released soon. Please reopen this issue if you still have problems. Thanks!

gaborcsardi avatar Apr 07 '24 10:04 gaborcsardi