Pathem
Browse all guides

Use the terminal and external commands

Open a shell near your files, control folder following, and review external command templates before running them.

Open and orient the embedded terminal

  1. Activate the pane whose folder you want to work in, then run Toggle Terminal. Control-backtick is the default terminal shortcut.
  2. Run pwd in the shell and compare the result with the intended folder. Do this before any command that can change or remove files.
  3. Use Terminal Follows Folder to control whether navigation updates the shell location. Do not assume an existing shell always follows a newly active pane.
  4. Navigate to another practice folder and run pwd again to verify the behavior. If you want a separate terminal application instead, use Open Terminal Here where available.
  5. Hide the terminal when finished. A visible file pane and a terminal prompt can point at different locations; the actual shell's working directory governs its commands.

Add a small external command safely

  1. Open External Commands… from Command Palette and create a clearly named command.
  2. Review the supported template placeholders shown in the editor. Read their meaning there rather than guessing which one expands to filenames versus full paths.
  3. Start with a harmless command that prints or inspects selected test files. Do not start with deletion, recursive permission changes, or a template copied from an untrusted source.
  4. Select disposable files with spaces in their names and test the command. Inspect the expanded behavior and exit result before adding it to your toolbar or keymap.
  5. Edit or remove a command when you no longer need it. Renaming a command's display title does not make an unsafe shell template safe.

If a shell command fails

Check the command's working directory, executable availability, shell configuration, and selected files. A command that works in a different terminal may rely on PATH entries or startup files that are not present in this session.

Do not troubleshoot a failed command by adding sudo or broadening permissions blindly. Reproduce it with harmless input and capture the error without secrets. For editor handoffs rather than shell scripts, the pathem command-line tool is usually a simpler integration.