How to use profiles to change how Terminal windows look in macOS

Jump to First Reply
Posted:
in macOS

The Mac Terminal app is your window into macOS's UNIX underpinnings. Here's how to customize the appearance of Terminal in macOS.

macOS's Terminal windows can be customized using the Settings window.
Use customization to change the look of Terminal windows.



The UNIX operating system standard goes back decades. To 1970 in fact, when it was created at Bell Labs using the C programming language.

There have been countless variants of UNIX over the years, and AT&T still owns the patents and rights to what is now known as UNIX System V.

One variant of UNIX called Berkeley Sockets Distribution (BSD) was created at the University of California at Berkeley in the 1980s.

BSD's most notable addition was the inclusion of TCP/IP network sockets and libraries. BSD enabled the birth of the modern mainstream internet as we know it.

Another variant of BSD is FreeBSD, and versions 3.3 and 4.2 are the most commonly used versions. They are also the versions macOS and iOS are based on, along with the mach microkernel from Carnegie Mellon University.

UNIX and terminals



In the early UNIX days, users didn't have PCs - they connected to a UNIX mainframe computer via computer terminals. They were "dumb" devices that included a keyboard and display, but most of which lacked any processing power.

The earliest mainframes didn't even have terminals - they processed programs stored on punch cards, and printed output on dot-matrix printers that used scrollable paper.

Terminals sent and received UNIX commands, plus data and output to and from a UNIX mainframe to run programs. Mainframes acted like the CPUs or cores found in most desktop PCs today.

Several terminal standards emerged and evolved, and computer companies such as Digital Equipment Corporation and others sold desktop terminal devices such as the VT100 and more to connect to mainframes.

Later, small mainframe-like computers called minicomputers were developed, which shrunk the size of the server computer down to a fraction of the mainframes' size. But even most early minicomputers were large by today's standards and required a small room.

Once the PC revolution started in the late 1970s, minicomputers were soon replaced with desktop PCs, or microcomputers. Even so, UNIX still had not emerged on the desktop until now-defunct Sun Microsystems began shipping its SPARC workstation computers for university and engineering markets in the 1980s.

AT&T also shipped its own UNIX PC around the same time.

Sun's Solaris OS was the first real, practical, mainstream desktop UNIX variant, and it made Sun an overnight success.

For common users, however, PCs still didn't offer a standard UNIX. They mostly used either Microsoft Windows or Apple's early Mac operating system, which later became known as Mac OS.

All that changed in 2000 when Apple shipped the first version of Mac OS X, which today is simply known as macOS.

UNIX was invented at Bell Labs in the 1970's.
Brian Kernighan - co-creator of UNIX and the C programming language.

The macOS Terminal app



Apple and its predecessor NeXT had the foresight to ship a Terminal app with their operating systems from day one. Today, the Terminal lives on and is included with every copy of macOS in the /Applications/Utilities folder at the root of every macOS Startup Disk.

To run Terminal in macOS, you open it from the Utilities folder.

When you do, you get a single window that contains a UNIX terminal just like in the minicomputer days.

Terminal startup and Settings



When you open Terminal, it starts a new shell (a window for executing UNIX text commands). You can open multiple shell windows in Terminal at once (or one in each tab) and run separate commands in them.

You can also run shell scripts in Terminal windows by dragging them to a Terminal window from the Finder and pressing Return on your keyboard.

Shell scripts are plain text files that contain a list of commands to run. In macOS, you can use the bash or zsh shell - which are variants of the standard UNIX command shell.

Terminal also looks for special configuration files to execute at startup in the user's home folder, in the private/etc folder (which is normally hidden in the Finder), and in several sub-folders within these folders.

To run a UNIX command in a Terminal shell, type it in (along with any options or parameters), then press Return on your keyboard.

The default macOS Terminal shell window uses black on white text, but it's easy to customize the look and feel of Terminal windows by using the Terminal->Settings menu. This opens a Settings window that contains dozens of options.

Customizing Terminal in macOS



Once you open the Settings window in Terminal, there are four tabs - the most important of which are General and Profiles.

The General tab lets you set which Profile to use when Terminal starts, which shell to use, and how new windows and tabs behave when they first open.

Use the General and Profiles tabs to select which Profile to use on startup.
The Terminal Settings window with the Profiles->Text tab selected.



The Profiles tab lets you edit Profiles and other options such as:

  1. Default window size

  2. Text properties

  3. Keyboard options

  4. Shell behavior

  5. Hardware terminal emulation options



The Advanced tab displays the hardware terminal options where you can make Terminal windows and tabs act like real hardware terminals, such as the DEC VT series, X-Windows xterm, and set text encoding.

You can also set terminal bell options such as audible or visual bell, how the text cursor behaves, and how input is interpreted.

There are numerous default profiles included in the Terminal app, and Basic (black on white) is the default. To set any other Profile as the default, select it from the list on the left and click the Default button below the list.

Another really cool feature of Terminal is that you can click the small ... icon next to the Default button and select Export... from the popup menu. This saves the selected Profile's settings to a .terminal file, which you can then open on another Mac in Terminal.

You can also create new custom Profiles by clicking the + button, and then setting the Profile settings the way you like. Each Profile should have a unique name to identify it.

Most early UNIX hardware terminals used white on black or green or amber text on black. This depended more on the color of the CRT phosphor on the device's display than on settings.

Terminal in macOS simulates the original typical terminal look in the Pro Profile.

For a really wild terminal emulator which looks just like an old phosphor CRT terminal display, check out the cool free app cool-retro-term from Swordfish90.

You'll need to bypass macOS's Gatekeeper security in the System Settings app the first time you run cool-retro-term.

Use the Settings->Window tab to change Terminal window technical details.
The Settings window with the Window tab selected.

Customizing text and windows in Terminal



To change the look and feel of any Profile in Terminal, you can click the Text and Window tabs. You can even change how predefined Apple Profile settings look by selecting one of them in the list on the left, then changing that Profile's options in the tabs on the right.

Note that there is no Save or Apply button for Terminal settings - any changes you make take effect immediately if you have a window or tab open that uses the Profile you are editing.

For the Text tab, the most important options are:

  1. Background

  2. Font

  3. Antialias text

  4. ANSI colors

  5. Cursor



Some later hardware terminals could also display text in colors - but only in the ANSI colors listed. Early UNIX terminals also had slight differences in the text cursor - the carat at the current command prompt.

Most early UNIX terminal cursors were either an underscore, a block, or a vertical line character. Some UNIX terminal cursors could also blink, some didn't.

You can set all those options under the "Cursor" section of the Text pane as well.

In the Window tab, the most important options are:

  1. Title

  2. Working directory

  3. Active process name

  4. Shell command name and TTY name

  5. Dimensions

  6. Window size



The working directory (or pwd in UNIX lingo) is the local folder on the filesystem of your Mac that Terminal is currently using.

"pwd" in UNIX stands for Present working directory. This directory can be any folder on any disk volume, as long as the volume is mounted on the Finder Desktop and listed in the hidden /Volumes folder on your Startup Disk.

You can find which pwd your Terminal shell is currently in by typing:

pwd and pressing Return in any Terminal window.

The pwd folder name shows up on the left side of the Terminal window title bar if the Working directory option is checked. If so, when you change the pwd in Terminal using the cd (change directory) UNIX command, the text in the window's title bar changes with it.

Use cool-retro-term to simulate old CRT terminal displays.
cool-retro-term in action.



The Active process name checkbox determines whether or not Terminal windows display the currently running process in their title bars. If so, it will be listed next to the pwd name (if enabled).

In this case, "process" simply means a program currently running in a Terminal window or tab.

A process in UNIX is simply a binary faceless app (usually) running without any GUI. You can terminate any running process in Terminal by pressing Control-Z or the q key on your keyboard.

Most UNIX commands are single binary programs stored on disk as part of the operating system. The default process name displayed in window title bars in Terminal is just the shell name, which itself is a process.

TTY - one of the earliest terminal technologies



You may have noticed one setting on the Window tab labeled TTY name.

TTY is short for teletype - an electro-mechanical device used to send text messages remotely. It became popular in the 1930s and was in mass use all across offices in the US, Europe, and the UK from the 1930s until at least the late 1970s, when they were replaced with terminals or PCs.

We won't bore you with the details of the teletype's origin, but as brief a history as possible might be: they were derived from teleprinters which arrived in the mid to late 1800s. They were in turn derived from the telegraph system, which used a simple pulse-coded analog language called Morse code.

Telegrams, which were popular in the 1940s and 1950s, were small short printed messages that were printed at the destination and delivered by hand. It created an entire industry of its own before more modern technologies replaced it.

Telegrams were the text messages of their era, albeit a little slower.

One modern enterprising company named iTelegram still lets you send hand-delivered paper telegrams over the internet for a small fee.

Teleprinters replaced telegraph terminals and operators and were in wide use from the 1930s to the 1950s. Teleprinters eventually gave way to the teletype, which was superseded by computer terminals.

In the late 1970s, all of these systems were replaced with or added to Telex - a unified text transmission service which could send text messages over what today is known as Plain Old Telephone System (POTS) lines. Telex had the advantage of being multiplexed, but it was extremely slow at approximately sixty-six words per minute.

One huge advantage of Telex's multiplexing was that it could send messages from one source to multiple destinations simultaneously, much like email can today.

Most Telex machines looked similar to electronic typewriters but usually had a built-in phone as well. Telex terminals were similar to modern FAX machines, but with a keyboard.

Teletype or Telex terminals would often be labeled in sequence by numbers within organizations to distinguish one terminal from another.

In today's macOS Terminal, if you turn on the TTY name setting, you'll see each tab in a Terminal window labeled with sequential numbers such as "ttys000", "ttys001", etc.

PDP-11 microcomputer at Bell Labs.
The now legendary photo of UNIX developers Dennis Ritchie and Ken Thompson in 1972 working on a UNIX PDP-11 minicomputer at Bell Labs. Note the teletype-like paper terminal.

Terminal window sizes



If you turn on the Dimensions checkbox in the Window tab, each Terminal window will display the size of the window in the window's title bar.

This size is the current actual size of the window, not the size the selected Profile will use. To set the default window size for any Profile, turn this setting on, then copy the two window dimension values into the Columns and Rows fields under "Window Size".

You can change the current window size in Terminal simply by clicking and dragging a window's corners or edges. As you change the window size, the dimensions in the title bar will change with the window.

Using this method, you should be able to get Terminal windows to start up just the way you like them.

There are other ways of setting Terminal display options, such as setting environment variables, UNIX profile files, startup files, and more. We may cover this in a future article.

For now, the Apple-provided Terminal settings should be more than enough to get you started customizing Terminal to your liking.

Also see our previous article How to clear Terminal's command history in macOS.

Apple has a page titled "Use profiles to change the look of Terminal windows on Mac in the Terminal User Guide.

For a really good UNIX history read, check out Brian Kernighan's book UNIX: A History and a Memoir.



Read on AppleInsider

linkman

Comments

  • Reply 1 of 5
    Nice trip back through memory lane.  Thanks. 
    linkman
     1Like 0Dislikes 0Informatives
  • Reply 2 of 5
    Penzipenzi Posts: 38member
    Yeah, I really enjoy Chip’s pieces. I’ll resist the puns.

    His work seems out of place on a site like AppleInsider and I appreciate it all the more for that. An in-between that deepens my knowledge and understanding of the tech I use daily. I always enjoyed the command line and should dive deeper and Chip provides an impetus…
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 5
    linkmanlinkman Posts: 1,058member
    Something I've seen a lot at work is users spending way too much time customizing the colors on their ssh terminal settings and making the session essentially unusable (e.g.: bright red background with nearly the same color red text -- yuck!). Then they had to contact me because they can't figure out how to restore their settings to original or something usable again. We ended the problem by making the settings file unwritable by users and their changes only affected in-memory sessions. Strange, I didn't see people customizing their mainframe 3270 sessions in the same manner.
     0Likes 0Dislikes 0Informatives
  • Reply 4 of 5

    A process in UNIX is simply a binary faceless app (usually) running without any GUI. You can terminate any running process in Terminal by pressing Control-Z or the q key on your keyboard.

    Control-z suspends the current foreground process (fg resumes it, or bg runs it in the background).
    Control-c terminates it, or often q too.
     0Likes 0Dislikes 0Informatives
  • Reply 5 of 5
    Really nice summary - reminds me of lots of things I experienced "then or then-abouts"

    One nit - leaving out Linux gives a little too much credit to MacOS.  Yes, The UNIX history is absolutely correct - no debate.  Sun became fabulously successful with SPARC, and UNIX was really a server and workstation OS only until MacOS X.  But Linus Torvalds worked around that by coming out with the Linux kernel in 1991.  When and how that became a "desktop" is its own subjective argument (KDE vs GNOME, etc.) but Dell offered Linux as an install option by 1999/2000 if I recall correctly.  
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.