May 17, 2019

iterm2 Status Bar

One of the neat features of the Iterm2 is the Status Bar. This is available in the 3.3.0 build - which is still in beta as of this post. The Status Bar is a thin bar at the top of the command window which displays useful information.

item Status Bar

Status Bar Options

The status bar has 11 built in configurable components, with more sure to be added. You can configure the Text Color and Background color. These are the components in the current beta:

  • Battery Level - How your laptop battery is doing.
  • CPU Utilization - Is your computer getting maxed out?
  • Memory Utilization​ - Check out your computer Memory Utilization before running a process.
  • Network Throughput​ - If downloading files is taking a long time, perhaps its too much network traffic.
  • Clock -System Clock, with a customizable date format settings. ( I like the following date format: EEEE, MMMM d, yyyy h:mm:ss a z)
  • Custom Action - Easily Select any Menu item, great for those actions that you want to implement right away - such as 'Split Horizontally with a Profile' or
  • git state - Once you install the command utility 'it2git,' you'll be able to always know what branch you're working on.
  • Host Name - Show the current host that your working on
  • User Name - What the current user is - useful if you do a lot of user switching.
  • Job Name - What job/process is currently running.
  • Current Directory - Avoid typing 'pwd' and instantly know where you are.
  • Search Tool​ - Find something on the current window, and that search term stays as you do work in the window - so you can make 'Exceptions' or 'Errors' will stand out as they occur.
  • Composer - Prep up a command before executing it. for example if you have a large SQL Statement but need to change a value in the middle, use this as a staging area before you execute it.
  • Fixed-size Spacer - Add flexible amount of space between components.
  • Empty Space - Just an empty space.
  • Interpolated String - Show some custom text with variables (See the document on some ideas.)
  • Call Script Function - Run a Python Function. (See the document on some ideas.)

Finding the Status Bar

If you're using iTerm2 3.3, you can enable the status bar using the Profile Preferences.

  • From the iTerm2 Menu select Preferences (Or use the shortcut Command ,)
  • Select Profiles
  • (The Default one should be selected)
  • Select the Session tab
  • Enable the check box next to "Status bar enabled" (Its the last item under Miscellaneous)
  • Then Configure your bar!

After you install the bar, you can right click on the bar and select 'Configure Status Bar.'

You will need to do this for each of your profiles that you have setup.

Installing Shell Integration

Some of the commands work better with installing Shell Integrations on remote servers. You can easily install the Shell Integration tool to get the most out of iTerm2:

  • SSH to any box
  • Select the iTerm Menu and then select "Install Shell Integration" which is the second to last menu item.
  • You'll be prompt if you want to install the Utilities tool. The additional tools allow you to see inline images via 'imgcat' command, List files with a thumbnail view using the 'imgls' command., Upload files via the 'it2ul' command among other utilities. (Full details on the iTerm2 Documentation page.)
  • You will need to login to try out the tools and see the effect of the Shell Integration.

Iterm2 is pretty powerful application and very useful to have if you doing a lot of shell commands on your Mac.

Comments


ikomrad

August 7, 2019.

Question on custom actions - can you make one that displays the current shell in the status bar ? ie BASH/ZSH/KSH/etc ?

Add your Comments

Feel free to leave a comment about this post.

- Feel Free to add HTML to your comment!