request: blank option for iTerm2 title suffix

20 views
Skip to first unread message

Andrew

unread,
Feb 16, 2026, 7:51:00 PM (3 days ago) Feb 16
to iterm2-discuss
Hi,

I prefer to use my shell to wholly manage the terminal title. However, iTerm2 does not currently allow for that.

There is a dropdown menu in Profiles -> General -> Title, with several choices of how iTerm2 populates the suffix.

So I guess, I'm requesting that we simply add an option there to indicate blank.

Or, a boolean switch to toggle whether iTerm2 title suffixes are enabled vs. disabled.

Robbie Gates

unread,
Feb 18, 2026, 12:00:15 AM (yesterday) Feb 18
to iterm2-discuss
I prefer to use my shell to wholly manage the terminal title. However, iTerm2 does not currently allow for that.

I have similar preferences and currently do this. 
 
There is a dropdown menu in Profiles -> General -> Title, with several choices of how iTerm2 populates the suffix.

I have checked the "Applications in terminal may change the title" checkbox below this, and manipulate it with xterm escape codes which iTerm respects:

print -n "\e]2;YOUR TITLE HERE\a"

It does not seem to get reset unexpectedly.
I actually do this from a zsh precmd hook, but it should work from PS1 if that's your preference, or directly if you want it manual vs automated.

 - Robbie

George Nachman

unread,
Feb 18, 2026, 1:27:18 AM (yesterday) Feb 18
to iterm2-...@googlegroups.com
If an app uses only \e]2;My Title\a (OSC 2):
  - Window title: "My Title" (early return, wins completely)
  - Tab title: ProfileName (job) — user@host:~/path (OSC 2 is completely ignored)

If an app uses \e]0;My Title\a (OSC 0, sets both window and tab title):
  - Window title: "My Title" (from windowName)
  - Tab title with components: My Title (job) — user@host:~/path (combines)
  - Tab title with components=0: "My Title" (pure app control)

The control sequence \e]2;...\a works for the window title but not the tab title. Use \e]0;...\a or \e]1;...\a to affect the tab. That title gets combined with other components specified in the profile’s title setting. But you can disable them all, at which point only the control sequence-provided tab title will be used. Here’s how it looks when they are all disabled:


Note that the title shows as “Shell”, which is the fallback string if no control sequence has set a title.

I hope that clears it up! It is more complicated than I'd like in part for backward compatibility and in part to accommodate widely varying preferences.



--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/iterm2-discuss/6963098d-7390-4009-9a38-d5f1bbdb1eadn%40googlegroups.com.

Robbie Gates

unread,
Feb 18, 2026, 4:13:09 PM (yesterday) Feb 18
to iterm2-discuss
Thanks George - I'm reading this right that the escapes \e]1;...\a \e]2;...\a win completely and override any settings dialog preferences, but  \e]0;...\a uses the escape and settings combined for the tab?
I've only used 1 & 2 (not 0) and never seen the settings Title (which I didn't realise I could unset tbh) leak through?

 - Robbie

George Nachman

unread,
5:45 PM (6 hours ago) 5:45 PM
to iterm2-...@googlegroups.com
0 will set both and is equivalent to sending 1 and then 2 with the same title.
Here’s what I get when I configure my profile’s title to show the current job. As you can see, code 1 sets the tab title, code 2 sets the window title, and the job is shown in the tab title:



Reply all
Reply to author
Forward
0 new messages