Manage OS X Terminal processes and windows with the inspector

TerminalIconXIf you are a Terminal user, and especially a power user, then you might regularly launch multiple Terminal windows, run various scripts, and have commands running in the background. Unfortunately it may sometimes be difficult to pinpoint which running processes belong to what terminal window.

For instance, if you have the synchronization tool “rsync” running in several Terminal windows, you might not know which one in Activity Monitor corresponds to a specific window. Therefore, if you need to kill one of the processes for whatever reason, you might have a difficult time doing so.

In addition to managing processes in this way, you might have a reason to edit your Terminal window title, or the title of a tab or two, which can make identifying tasks in your workflow far easier.

If you have a need for any of these features, then you can make use of the Terminal inspector, which can be invoked by bringing a specific Terminal window into focus and then pressing Command-i. In the information window that pops up, you will have several options.

Terminal inspector in OS X

The Terminal Inspector will allow you to send various signals to running processes, and manage window sizes and titles.

  1. Set the window size
    You can set the X and Y window bounds in units of lines on the vertical axis and characters on the horizontal axis. While you can also do this by simply resizing the window, this option allows you to specify the number of lines and characters exactly, instead of fishing around with manual resizing.
  2. Set tab and window titles
    While the Terminal will automatically label tabs and windows based on the shell and foremost process name, you can customize this. For instance, if you have several SSH connections to remote servers, you can give them names like “SSH: Web server” and “SSH: Work File Server” to differentiate them. However, often Terminal windows are opened and closed so often, that the utility in this is rather lost.
  3. Set the display theme
    You can specify the default theme to use for Terminal windows in the program’s preferences; however, you can also change the theme for a window at any time using the inspector’s “Settings” tab.
  4. Manage Terminal processes
    The last feature of the Terminal information window is its ability to manage processes running within the given window. At the bottom of the inspector you will see a list of these processes and their process IDs, but by right-clicking them you will get a contextual menu with options to copy just the name, the process ID, or both. You can also access the “Signal Process Group” submenu to send a signal (ie, Kill, or Hang Up) to the process.

    These are the same signals you can send to these processes in Activity Monitor, but you can instead use these to target the processes in a specified Terminal window instead of having to hunt through them in Activity Monitor.