Launching R gui from the command line and setting the working directory to the current folder - r

On a Mac, is there a way to launch the default R gui from the command line, with the working directory set to the current folder?

assuming R.app is in your Applications folder:
open -a /Applications/R.app .

Related

How do you open an Rstudio project with a Git Bash command?

I am looking for a command to start an Rstudio project using Git Bash from the Git for Windows installation. I am looking for a command that opens the project in Rstudio, similarly to how it would open if you double-clicked on the .Rproj file in the Windows file explorer. I have Rscript.exe added to my PATH. Thanks!
You have to add "C:\Program Files\RStudio\bin" to your PATH. This will give you access to rstudio.exe. You may then run rstudio path-to-my-project.Rproj in the bash command line, and it will open as desired in OP.
Edit: If RStudio is the default program to open .Rproj files, you can run explorer path-to-my-project.Rproj, and this will also open the project as desired.
On MacOS you can use open, or on Linux xdg-open. E.g., open path/to/your-project.Rproj. See Connor's answer for Windows.

Open Site Shell doesn't work with Local by Flywheel on Linux

Installed Local by Flywheel on Garuda Linux running KDE Plasma. From the sites context menu the Open Site Shell command doesn't launch a shell.
On Linux, Local is using gnome-terminal. When Open Site Shell command is used, gnome-terminal is executed with a script as an argument. There are couple of ways this can be resolved:
Install gnome-terminal package.
Create a shell script gnome-terminal and put in a folder in your PATH.
Using the second option, my /usr/bin/gnome-terminal` contains:
#!/bin/bash
exec /usr/bin/konsole -e "/bin/bash $#"

Change terminal in Atom-editor's Platformio-Ide-Terminal on Windows

On Windows, default terminal for Atom's Platformio-Ide-Terminal is Powershell (at least, that is what I get without any configuration).
I would prefer a terminal using unix-type commands. I already have MINGW and CYGWIN installed.
How can I avoid opening a Powershell and opening another terminal type instead?
Set the default shell in:
Edit>>Settings>>Packages>>Platformio Ide Terminal>>Settings>>Shell Override
You can use the git's bash as proposed here as you probably already have git installed.
C:\Program Files\Git\bin\bash.exe
Step by Step Solution
Go the Setting-> Packages -> In Search Bar, search for the platformio.
Open platformio and go to Shell Override Option.
Put the following line as per as your Terminal Requirement
For cmd- C:\\WINDOWS\\System32\\cmd.exe
For Power Shell- C:\\WINDOWS\\Sysnative\\WndowsPowerShell\\v1.0\\powershell.exe
For bash- C:\\Program Files\\Git\\bin\\bash.exe or C:\\Windows\\System32\\bash.exe (depending on how you install the bash). Be Sure, that you have already install the bash into your computer.
Now, you can integrate bash, cmd, git bash, Power Shell into Atom using platformio as terminal.
For CYGWIN users, the bash executable from the following location has proved useful for setting the shell override Settings >> Packages >> Platformio Ide Terminal >> Settings >> Shell Override
C:\cygwin64\bin\bash.exe
If you are now using Ubuntu for Windows 10 (downloaded from the app store), you can change it to that as well.
Ubuntu gets installed in Windows' PATH by default, so just change the default shell to:
ubuntu.exe
That's it. Just remember that to get to your code, cd to /mnt/(driveletter)/wherever/your/files/sit.
For someone who still can't get this to work because your git bash is installed in AppData. This worked for me.
C:\Users\saurabh\AppData\Local\Programs\Git\bin\bash.exe

PHPUnit Ansicon is not showing colors

Operating System: Windows 8.1 (64 bit)
Terminal: Git Bash
Purpose: Show colors in PHPUnit command results
Process followed:
Downloaded https://github.com/downloads/adoxa/ansicon/ansi160.zip
Extracted the file into C:\ansicon
Added C:\ansicon\x64 in "Path" user variables.
Opened Git Bash as administrator
Moved into C:\ansicon\x64 and executed ansicon -i without any errors.
Restarted Git Bash and moved into My test project.
Executed phpunit --colors TestFile.php
Problem: The result is showing but without any colors.
Question: What have I done wrong? How to solve it?

'RM' is not recognized as an internal or external command while using Meteor on Windows

i am currently having problem with 'meteor' and i am currently new to this learning this stuff. So, after installing 'Meteor' i opened command prompt on Windows and typed :
meteor create goodboy
and then,
cd goodboy
But to delete the live and already running example app, i used :
rm goodboy.*
But the command prompt, gave this error :
rm is not recognized as an internal or external command, operable
program or batch file.
Is there anyway i can fix this error, thank you.
Use del on Windows.
Also, this has nothing to do with Meteor. You can also delete a Meteor project by going to the folder and dragging it to the trash.
If you are on windows, git bash may run such commands.
If you are using Mac then we can simply use
rm -f src/*
and For windows we can use command for this is
del -f "src/*"
Hope this works fine for you.
Download and Extract PortableGit.
This has most of commonly used Linux based tools ported to windows.
Add [PortableGit Path]\usr\bin to PATH variable of Windows
You can also use your system's Git installation instead of PortableGit.
This should solve the problem
I'm running Git shell prompt and for some reason it doesn't have it any more. I ended up using Cygin to get it working:
https://www.cygwin.com/
My penny's worth.
You could potentially add rm to powershell. In your (or a) profile.ps1 (or other if your powershell is not core).
rm {
del
}
or as an alias
Set-Alias rm del
or (and this is a tricky one), run WSL, bind the target folder and run via the linux interface.
PS: running the command via the Git Bash (MINGW64) terminal as suggested above, did the trick for me.
I guess you are not using bash terminal. Try this..
1- Go to the folder that you want to remove its contents lets call it my-app folder.
2- Right click in the empty space, then choose get Bash here.
3- Paste the command rm -f A_folder/* (I'm about to remove the content inside A_folder folder which is a sub-folder inside my-app).
4- Hit enter.
That should remove all content from A_folder folder.
Hope that helps.
I guess you are not using the Git Bash terminal but the normal command prompt.
Do try the same on the Git Bash terminal and you would not face this error anymore.
first, install linux clients for windows, I use Ubunto LTS
then install node.js and run your command again.
here, you find good instructions to do it so, as well as how to install cool new Windows Terminal
you should add
"remove-build": "rmdir /s /q build",
"create-build": "mkdir build",
"clean": "npm run remove-build && npm run create-build",
in package.json

Resources