Skip to content

Automatic (Triggered) Profile Switching

Gerald Nunn edited this page Jun 11, 2016 · 11 revisions

Introduction

Terminix supports automatically switching profiles based on certain conditions which is useful in a variety of situations such as when connecting to different hosts, switching to sensitive directories, etc. At the moment Terminix supports triggering a profile change based on the following:

  • hostname
  • current directory

Note that when an automatic profile change is active, the menu to switch to different profiles will be disabled.

Local Configuration

Configuring profile switching in Terminix is done in the Advanced tab of the profile settings. Here you can configure the list of hostnames and directories that will trigger the profile change. The format used for the string is hostname:directory where either hostname or directory can be omitted but not both. For example, if you want to trigger a change just on hostname, enter hostname:. Similarly to trigger a change on just the directory, enter :directory.

Remote Configuration

To enable profile changes when using SSH to connect to remote systems, the remote system must be configured to include an additional script. This is required because typically on remote systems vte.sh is either not configured to run or may not even be present. The additional script provided by terminix overwrites the PROMPT_COMMAND to feed terminix the hostname and directory in a fashion identical to the way vte.sh normally does it.

To configure the script, simply scp the script /usr/share/terminix/scripts/terminix_int.sh from your local system where terminix is installed to the remote system. You will then need to source this script on the remote system, the easiest way to do this is to modify the .bashrc of the user you use to connect to include the script. For example, add the following to .bashrc:

. ./terminix_int.sh

if you switch users on the remote system, you may need to source the script somewhere so it is available to all users.

Clone this wiki locally