If you work on more than one project, your terminal probably looks familiar: a row of identical tabs, a server running in one of them, and no idea which. Every switch starts with working out which tab is which.
The fix is to organize your Mac terminal by project instead of by tab. This guide shows a setup that takes about two minutes.
Give each project one place
Think about what a project needs while you work on it. For a typical web app, that might be:
- A dev server that keeps running
- A terminal for tests
- A terminal for Git and everyday commands
Those belong together on one screen. When you change projects, you want to switch that whole set at once and leave the other one running.
In TerminalSpace, this is a workspace: a tab with its own terminals, layout, folder and color.
- Press ⌘ T.
- Name it after the project.
- Pick a layout.
- Set the project's folder as the Working directory, so its terminals start there.
- Pick a color you will recognize.
Repeat that for each project. You can then jump between them with ⌘ 1, ⌘ 2 and so on, while every shell keeps running.
Arrange the terminals around your work
Give the most important terminal the most room. A layout that works well for many projects is one tall terminal on the left for the server or editor, with two stacked on the right.
You can change the arrangement at any time:
- Press ⌘ D to split a terminal to the right, or ⇧ ⌘ D to split it downward.
- Drag a terminal by its header onto another to move it to that side, or drop it in the middle to swap the two. Your commands keep running.
- Drag a divider to resize, or double-click it to make two terminals equal.
Name your terminals
A name such as "Terminal 3" does not say what is running. Double-click a terminal's title and call it Dev server, Tests or Production.
For anything risky, go one step further and give that terminal its own color theme. A distinct background on your production shell is a useful reminder of where you are about to type.
Keep the commands you always forget
Everyone has a few commands they look up again and again. Save them as snippets and insert them from a menu in any terminal. TerminalSpace includes 110 ready-made ones for Git, Docker, Node, Laravel, Homebrew, SSH and more, and you can add your own.
A snippet is placed at the prompt without running, so you can check it and fill in any blanks first.
Stop watching long commands
Instead of checking on a long build, switch to something else. With command notifications, your Mac tells you when a command finishes in a terminal you cannot see, and clicking the notification takes you back to that workspace.
Pick up where you left off
When you reopen TerminalSpace, your workspaces, layouts, folders and recent output come back. Programs that were running do not, because quitting ends them, so it is worth stopping long jobs first. Closing the window, on the other hand, keeps every shell running.
A simple setup to start with
- Create one workspace for the project you are working on today.
- Use one large terminal and two small ones.
- Name all three.
- Save the one command you always have to look up.