Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Vivek Kodira
Vivek Kodira

Posted on • Edited on

     

Using Badges in iTerm2

Update: 1-Aug-2019: The example mentioned in this post is now redundant. Use iTerm'sstatus bar instead.

iTerm2 is a very powerful replacement to the built-in terminal. You can read more about whyhere.

This post will focus on one specific functionality I recently explored and found useful:Badges and is meant for beginners unfamiliar with iTerm2

Hello World

Let's start with a "Hello World" example.

  • Go to "iTerm2 > Preferences > Profiles"
  • Add the text "HelloWorld" to the input "General -> Basics -> Badge"

  • If you open up a new iTerm2 window, you should now see this:

  • This badge will be displayed in each tab. Split the window into two tabs and this is what you'll see.

  • Now lets make the badge display something useful like the name of the user and the machine. To do this, we'll first need to installShell Integration

  • Now, go back to the Preferences panel and change the Badge to\(session.username)@\(session.hostname)

  • iTerm will now display a more useful badge

Important: The "Install Shell Integration" step will have to be done oneach host you ssh into before you'll see the correct label.

Enjoy,
Vivek.

P.S: Badges also support more advanced features like user-defined variables. Experiment with them to get the look-and-feel you need. All you need to know is some basic bash scripting

References

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Location
    Bangalore, India
  • Joined

More fromVivek Kodira

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp