When the username, hostname, or path changes, iTerm2 finds the best-matching profile. Initially, the stack contains the profile the session was created with. ImplementationĮach session maintains a stack of profiles. The exception is if the last-matched rule was "sticky". If no profile has a matching rule, the session's original profile willīe restored. (for example, the hostname changes back to "localhost" because an ssh sessionĮnds). Automatic ReversionĪfter APS switches a session's profile, its rules may eventually cease to match The UI tries to prevent you from entering the same rule in two different profiles, but if that does happen then one profile is chosen arbitrarily. The highest scoring rule, if any, will be used and the session's profile will be switched. A partial match on the path using a wildcard scores zero points, but does count as a match for the rule.An exact match on the path scores one point.A match on the user name scores 2 points.A match on the job name (wildcard or not) scores 4 points.A partial match for the hostname using a wildcard scores 8 points.An exact match for the hostname scores 16 points.In order for a rule to be considered, all of its parts that are Quality isĭetermined by a rule's score, which is computed by summing the scores for its Quality matches prevail over those with lower-quality matches. ![]() This will be described below, in the Automatic Reversion section.īecause more than one rule may match at any given time, rules with higher For example, &emacs*.Īdditionally, a rule may be designated as sticky by beginning with a !. The job name is the name of the executable. A hostname may contain one or more * characters, which act as a wildcard (like globbing in Unix). It may include * wildcards.Ī hostname can be a DNS name, like or an IP address like 127.0.0.1. ![]() Any time a hostname is followed by a path, they are separated by a. The hostname is required only when both a user name and a path are specified.Ī user name is a unix accont name (e.g., root) followed by an path always begins with a /. At least one component must be present, since an empty rule is not allowed. Rules consist of three optional components: the user name, the hostname, and the path. When any session satisfies a rule in a given profile, it will switch to that profile. In Preferences>Profiles>Advanced, you may specify a set of rules. You must install Shell Integration on all machines and all user accounts where you plan to use Automatic Profile Switching (either by using the scripts or the Triggers workaround described in the Shell Integration docs). ![]() For example, your window's background color or the terminal's character encoding could change when connecting to different hosts. ITerm2 can use information it knows about your current path, host name, user name, and foreground job name to change profiles.
0 Comments
Leave a Reply. |