All articles

How to Open Terminal in the Current Folder on a Mac

· 5 min read

You are looking at a folder in the Finder and need a shell there, to run a script, git or npm install. Terminal opens in your home folder, so the usual ritual is cd followed by a long path.

The short answer: in the Finder, right-click the folder and choose New Terminal at Folder, under Services. If it isn't there, turn it on in System Settings › Keyboard › Keyboard Shortcuts… › Services, in the Files and Folders section. You can also drop the folder on Terminal's icon. In Folia Files, right-click a folder and choose Open in Terminal, or press ⌥⌘T for a terminal right under the pane, in its folder.

New Terminal at Folder, from the Finder

Turn on the service

Terminal comes with two services for the Finder: New Terminal at Folder, which opens a new window, and New Terminal Tab at Folder, which opens a new tab in the Terminal window in front. If you don't see them when you right-click a folder:

  1. Open System Settings, then Keyboard.
  2. Click Keyboard Shortcuts…, then Services in the list on the left.
  3. In the Files and Folders section, tick New Terminal at Folder, and the tab version if you want it.

The same list lets you give the service a keyboard shortcut of its own.

Use it

Right-click a folder in the Finder and choose New Terminal at Folder, near the bottom of the menu, under Services. With the folder selected, the same command is in the menu bar, under Finder › Services. Terminal opens with the shell already in that folder.

The service acts on a folder you select, not on the window you are in. To open the folder you are browsing, go up one level with ⌘↑ and right-click it there.

If you use iTerm2, it adds its own services to the same list: New iTerm2 Window Here and New iTerm2 Tab Here.

Two ways without the service

Drop the folder on Terminal

Drag a folder onto Terminal's icon, in the Dock or in Applications › Utilities: Terminal opens a new window in that folder.

Type cd, then drag the folder in

In a Terminal window, type cd followed by a space, drag the folder from the Finder into the window, and press ↩. Terminal types the folder's full path for you, with spaces and special characters escaped. The same works with a path you copy: how to copy a file path on a Mac covers the Finder's ways and Folia Files'.

The other way round, open . opens the shell's current folder in a Finder window.

Open in Terminal, in Folia Files

In Folia Files, right-click a folder in a pane, or an empty spot of the pane to use the folder it shows, and choose Open in Terminal. The submenu lists Folia Files Terminal first in the website edition, then the terminal apps installed on your Mac: Terminal, iTerm, Ghostty, Warp, Kitty, WezTerm, Alacritty, Hyper and Tabby, only those you have. Pick one and Folia Files opens the folder in it. There is no service to turn on first.

The Open in Terminal submenu of a folder in Folia Files: Folia Files Terminal first, then the terminal apps installed on the Mac

In the website edition, the folders, disks and favorites of the left sidebar have Open Terminal Here in their menu, which opens the built-in terminal in that folder; in the Mac App Store edition, they have the same Open in Terminal submenu.

For a shell that is already open, Copy Path › Path for Terminal (Escaped) copies the path with its spaces and special characters escaped, ready to paste after cd.

A terminal under the pane that follows your folders

Folia Files with the Atlas project in a pane and, under it, the built-in terminal in the same folder, Follow Pane ticked

Press ⌥⌘T, choose View › Terminal, or click Terminal in the toolbar: a terminal opens under the active pane, in the folder it shows, or in the selected folder if you selected one. The gear menu of the pane has the same command, Terminal in This Folder. The terminal's header says where it is, for example “Terminal — ~/Projects/Atlas”.

  • Follow Pane: tick it in the terminal's header, and each time the pane goes to another folder, Folia Files types the cd for you. It only does it while the shell is waiting for a command, never into a program running there, and never types a path that contains control characters. The choice is kept for the next terminals.
  • Go to the linked pane's folder, the arrow button next to it, does a single cd: handy when Follow Pane is off.
  • To close the terminal, click its ×, press ⌥⌘T again, or press ⌘W while the terminal has the focus. Closing it ends its shell.

Each pane can have its own terminal: with two folders side by side, you get a shell in each.

The shell is your login shell, zsh by default on macOS, started in the pane's folder with your usual configuration. Settings › Terminal sets another shell if you want one, along with the font, the cursor and the colors: Match Theme by default, palettes made to stay readable, or iTerm2 and Ghostty themes brought in with Import…. The built-in terminal page shows the rest, including your own commands in the menus.

Which edition has what

The built-in terminal is in the website edition of Folia Files only: Apple's sandbox doesn't allow it in the Mac App Store edition, and Folia Files Companion, the free helper app of that edition, doesn't add it either. In the Mac App Store edition, Open in Terminal lists the terminal apps of your Mac and opens the folder in the one you pick, and Copy Path › Path for Terminal (Escaped) is there as well.

Which way to choose

For a shell in a folder once in a while, the Finder's service does the job once it is turned on, and dragging a folder onto Terminal works on any Mac without setup. If you open a terminal in the folders you browse many times a day, a right-click that offers all your terminal apps, or a terminal that stays under the pane and follows it, saves the round trip through the Finder.