Required Setup for MacOS Users

The following instructions are designed to help get you up and running with macOS for development in CSCI 1302. The majority of the time, you will not be developing directly on your Mac. Instead, you will use your Mac to connect to a remote server via a terminal emulator. Once connected, the commands that you type and the programs that you run will be executed on the remote server instead of on your local machine.

Setup Ctrl-<SPACE>

If typing Ctrl-<SPACE> (i.e., ⌃Space) changes your keyboard layout, then you will need to adjust some settings as that keyboard shortcut is used heavily in one of the programs we’ll be using this semester. If it doesn’t, then you can skip to the next section.

To fix Ctrl-<SPACE>, click the apple icon in the top-left of your screen then select “System Preferences”. From there, go to the “Keyboard Settings” which may be just called “Keyboard”, then select the “Shortcuts” tab. Find the shortcut that is mapped to ⌃Space and either change it or disable it. Once you’ve made the change, you should be all set as far as Ctrl-<SPACE> is concerned.

Open Terminal

The macOS operating system comes with a terminal emulator called Terminal.

  1. Open Terminal. On your Mac, do one of the following:

    • Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal.

    • Click the Spotlight icon in the upper-right corner of the menu bar (or press Command-Space), type Terminal in the search field, then click Terminal.

    • In the Finder , open the /Applications/Utilities folder, then double-click Terminal.

  2. Explore. At its core, macOS is powered by a powerful Unix-like kernel called Darwin. Using Terminal, you can interact with your system using most Unix commands.

Use Option as Meta

Some of the programs that you will use this semester will require the use of the META key. On some systems, this is the same as the ESC or ALT key. On a Mac, you can set Terminal to use the OPTION key as META.

  1. Open Terminal.

  2. In the menu bar, click Terminal, then click Settings….

  3. In the window that appears, select the Profiles option at the top.

  4. In the tabs that appear below Profiles, select the Keyboard tab.

  5. Near the bottom of the pane, check the box for Use Option as Meta key.

  6. Quit the Terminal app by selecting Quit Terminal from the File menu (or by pressing ⌘Q).

Important

The setting does not take effect immediately! If you skip the last step above, your option key may still note work properly.

Install Homebrew

Homebrew is a package manager for MacOS. It makes it really easy to install programs on your Mac via Terminal.

  1. Open Terminal.

  2. Install Homebrew. To run the Homebrew installer, type the command below.

    Note

    The installer may ask you for a password. If it does, then it is referring to the password for your Mac.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    

    Important

    Homebrew must be installed to continue. If installation fails, inspect the messages emitted by the installer – in most cases, it will tell you what you need to do to fix the issues that are preventing installation.

  3. Inspect the last few lines that the Homebrew installer displays, then run the 2-3 commands that it mentions. You SHOULD copy all the commands by selecting them with your mouse, right clicking, then selecting “Copy.” Next, paste the commands after the % in your prompt by right clicking and selecting “Paste,” then press the return key.

  4. Install Utilities via Homebrew. Type the following command to install git and wget:

    brew install git wget
    

    If you run into issues with ``brew install``, then please try running brew doctor first to see if it has a suggested fix. If it does, then try the fix. If it doesn’t or if it does but that doesn’t resolve your issue, then you may need to ask Piazza or see an instructor during office hours.

Install XQuartz

XQuartz is an open-source version of the X.Org X Window System that runs on MacOS. Installing XQuartz will enable you to forward the graphical user interface for remote programs that you write later in the semester to your local machine.

  1. Open Terminal.

  2. Install XQuartz. Type the following command:

    brew install --cask xquartz
    
  3. Restart your Mac. The best way to restart your Mac is to choose Restart from the Apple () menu.