

Open iTerm2 and go to Preferences (Cmd + ,). Restart your terminal or run source ~/.bashrc to reload the configuration.ĭisplay Git Information in iTerm2 Status Bar Paste the copied contents at the end of your ~/.bashrc file and save the changes. Open your ~/.bashrc file using your preferred text editor (e.g., nano ~/.bashrc). ExampleĬopy the contents of the bashrc_snippet.sh file from this repository. Presence of and Number of untracked filesĪdditionally, the script allows you to toggle the display of individual features.

Number of files that differ between the local and remote branch.Number of staged commits on the remote repo.Number of commits ahead and behind the remote branch.The status bar allows you to modify the top of your prompt to show information about your terminal session, information that’s always present as you’re working. This custom script displays various Git information in the iTerm2 status bar, giving users a quick overview of their repository's state. 04 August 2019 Version 3.3.0 of iTerm2 introduces a cool new feature that allows you to customise the status bar.

To address this issue, as well as expand upon the original, this custom script was made. The original "git state" menu bar component would sometimes not work or not show at all. NOTE: Due to technical limitations, this search cannot handle extended characters. You can then add the item to you touch bar from View > Customize Touch Bar.This repository contains a custom script that provides a more reliable and full-featured Git status bar component for iTerm2. You can define custom touch bar buttons in Prefs > Keys > Add Touch Bar Item. git & (git rev-parse -abbrev-ref HEAD) || (echo -n "Not a repo"))")\] '
#ITERM2 GIT STATUS BAR INSTALL#
If you install Shell Integration and Utilities, then you'll get a command it2setkeylabel that lets you configure what the status control says. The status touch bar control shows a user-configurable message. That history is used to make suggestions for commands, which appear in this touch bar control. If you have Shell Integration installed, iTerm2 can remember you command history. If you have Shell Integration installed, each command prompt inserts a mark, so the previous mark is usually the previous shell prompt. There are also touch bar controls to navigate marks. You can navigate among marks with Cmd-Shift-Up and Cmd-Shift-Down. The Add Mark touch bar control saves the current location in history. You can configure each application you use (such as vim or emacs) to set the labels appropriately. If you install Shell Integration and Utilities, then you'll get a command it2setkeylabel that lets you configure what each function key's label says. It takes more space but is quicker to use. The second, labeled Function Keys, shows a scrollable list of function keys at all times. It is compact but requires two taps to press a function key. The first, labeled Function Keys Popover, opens a scrollable list of function keys when pressed. Choosing one changes the current terminal's colors to use the preset. When selected, this opens a scrollable list of color presets. Opens the manpage for the command behind the cursor. The following controls are available: Man Page As with many applications, you may customize the controls on the touch bar with View > Customize Touch Bar.
