Try changing preferences to "New terminal opens with bash." You'll still be able to set up for git, and most of the time you'll be using the Console pane. Terminal is just there for convenience for things like moving files from download to your working directory.
Once you enter your code in my-first-script.R, you can either cut and paste it into the console or, better yet, just hit CTRL-ENTER