Add support for remapping prefix key

Make it possible to remap the prefix key (default: ctrl-t) by setting
the prefix-ctrl-key variable in the configuration file.

Allowed values are in the range a..z.

Example, to set the prefix key to ctrl-a simply do:

prefix-ctrl-key = a
This commit is contained in:
Martin Lund 2022-07-15 11:58:53 +02:00
parent 1c53af0681
commit 02729c10b1
9 changed files with 36 additions and 34 deletions

View file

@ -237,6 +237,15 @@ static int data_handler(void *user, const char *section, const char *name,
asprintf(&c->socket, "%s", value);
option.socket = c->socket;
}
else if (!strcmp(name, "prefix-ctrl-key"))
{
if (ctrl_key_code(value[0]) > 0)
{
option.prefix_code = ctrl_key_code(value[0]);
option.prefix_key = value[0];
}
}
}
return 0;
}