console-multiplexor-control 1 user commands nosh
console-multiplexor-control chvt control a (user-space) virtual terminal multiplexor
`console-multiplexor-control` command command@vtname `chvt` command command@vtname

## Description

`console-multiplexor-control` controls a user-space virtual terminal that is driven by console-multiplexor 1, or the multiplexed set of kernel virtual terminals.

vtname is the (optional) name of the virtual terminal. It can be a directory relative to `/run/dev` for a user-space virtual terminal multiplexor, or a character special file relative to `/dev` for the kernel virtual terminals. If omitted, it defaults to `head0`.

command is one of:

`S`

  Switch to the first session, as if the "select task" USB consumer key were pressed.

`N`

  Switch to the next session, as if the "next task" USB consumer key were pressed.

`P`

  Switch to the previous session, as if the "previous task" USB consumer key were pressed.

number

  Switch to the session numbered number, as if its session selection key were pressed. Sessions are numbered starting from zero.

## Security

Session switching is done by injecting switch command events into the input stream. Permission to inject things into the input stream is implicitly permission to generate arbitrary keyboard and mouse input to a session. Usually the only accounts with such privileges are the superuser and the accounts used to run the dæmons that form the user-space virtual terminal subsystem.

Session switching under programmatic control with a tool such as this can unexpectedly switch users away from password prompts and the like. Be careful about granting users the privilege of performing these actions. For best results, only the user physically at the user station(s) where the multiplex virtual terminal is being realized should be able to generate session switches, with actual keyboard actions.

(The kernel virtual terminal system shares these caveats and risks. They are simply rarely discussed.)

## Author

Jonathan de Boyne Pollard