Session Name containing URL scheme variables is no longer stable
- iTerm2 version: 3.3.1
- OS version: 10.14.6
- com.googlecode.iterm2.plist
- debuglog.txt
One of my favourite features of iTerm2 has long been its capability, when configured as the ssh URL scheme handler, to have my tab's titles set to include the remote username (if non-default) and hostname without the user of remote shell integration (not always possible) or escape codes. I would do this by setting my profile's name to $$USER$$@$$HOST$$
and with the Title property set to Session Name. For example, in response to ssh://user@hostname
this would result in the tab title being set to user@hostname
; for ssh://hostname
the title would be simply @hostname
. I have even built an Alfred Workflow designed to exploit this functionality.
With the release of iTerm2 3.3, this behaviour is now functionally broken. Whilst the tab title is set correctly immediately after the URL scheme profile is triggered, any subsequent interaction with the Session Editor, even that of a different session using a different profile, results in the "magic" URL scheme tokens losing their magic, and all remote session titles in all open windows reverting to the literal text $$USER$$@$$HOST$$
.
Detailed steps to reproduce the problem:
- Open one or more remote ssh sessions using iTerm2's registered ssh URL handler: e.g.
open ssh://remoteuser@hostname
. - Open the "Edit Session…" dialogue (Cmd+I) in any iTerm2 tab or window.
What happened:
- The ssh tab's title switched to
$$USER$$@$$HOST$$
.
What should have happened:
- The ssh tab's title should be unchanged unless the Session Name is explicitly changed in its own Session Editor.
Directly related feature request / alternate resolution:
(Unless I missed it in an earlier release) iTerm2 3.3.0 introduced the option of using User and Host properties in the Title configuration of a Profile (the same location I'm currently setting "Session Name"); it even nicely formats these as User@Host
when both are selected (nice!).
Unfortunately, even for a profile configured to handle a URL Scheme, these properties always reflect the local username and hostname of the user/host running iTerm2 rather than the values interpreted by the URL Scheme handler.
Ideally, User
and Host
should be set to the same values as $$USER$$
and $$HOST$$
in the context of a Profile handling a URL Scheme, including empty strings if the associated value is not specified. This would allow me to completely avoid the hack of using URL Scheme variables in the Profile name.