I tend not to use tabs and instead have a bunch of windows so I originally wanted to know how I could set my window title bar to show the current path, but in this post I’ll share how to do both in iTerm2.
Here is a screenshot of the iTerm2 Preferences window showing Profiles -> Window.
![Screenshot 2023-01-25 at 09.32.20.png Screenshot of iTerm2 Preferences Window showing how to set custom window title and custom tab title](https://cdn.uploads.micro.blog/35716/2023/8039dfc5a3.png)
For custom window title you’ll set \(currentTab.currentSession.path)
.
For custom tab title you’ll set \(currentSession.path)
.
And that’s it!
Here’s what it would look like in iTerm2:
![Screenshot 2023-01-25 at 09.36.35.png Screenshot of iTerm2 with custom window and tab titles](https://cdn.uploads.micro.blog/35716/2023/67bcb6abe1.png)
And here’s the Stack Overflow question I found that solved this for me. Wanted to blog about it so that I remember how to do this in the future.