goto err_name;
ret = uterm_vt_allocate(app->vtm, &seat->vt, seat->sname,
- seat->input, vt_event, seat);
+ seat->input, kmscon_conf.vt, vt_event, seat);
if (ret)
goto err_input;
"\t --debug [off] Enable debug mode\n"
"\t --silent [off] Suppress notices and warnings\n"
"\t-s, --switchvt [off] Automatically switch to VT\n"
+ "\t --vt <vt-number> [auto] Select which VT to run on on seat0\n"
"\t --seats <list,of,seats> [seat0] Select seats or pass 'all' to make\n"
"\t kmscon run on all seats\n"
"\n"
CONF_OPTION_UINT(0, "fps", NULL, &kmscon_conf.fps, 50),
CONF_OPTION_STRING(0, "render-engine", NULL, &kmscon_conf.render_engine, NULL),
CONF_OPTION_BOOL(0, "render-timing", NULL, &kmscon_conf.render_timing, false),
+ CONF_OPTION_INT(0, "vt", NULL, &kmscon_conf.vt, UTERM_VT_DEFAULT),
CONF_OPTION_BOOL('s', "switchvt", NULL, &kmscon_conf.switchvt, false),
CONF_OPTION_BOOL('l', "login", aftercheck_login, &kmscon_conf.login, false),
CONF_OPTION_STRING('t', "term", NULL, &kmscon_conf.term, "xterm-256color"),
UTERM_VT_DEAD,
};
+#define UTERM_VT_DEFAULT (-1)
+
typedef int (*uterm_vt_cb) (struct uterm_vt *vt, unsigned int action,
void *data);
int uterm_vt_allocate(struct uterm_vt_master *vt, struct uterm_vt **out,
const char *seat, struct uterm_input *input,
- uterm_vt_cb cb, void *data);
+ int vt_for_seat0, uterm_vt_cb cb, void *data);
void uterm_vt_deallocate(struct uterm_vt *vt);
void uterm_vt_ref(struct uterm_vt *vt);
void uterm_vt_unref(struct uterm_vt *vt);
return 0;
}
-static int real_open(struct uterm_vt *vt)
+static int real_open(struct uterm_vt *vt, int vt_for_seat0)
{
struct termios raw_attribs;
struct vt_mode mode;
log_debug("open vt %p", vt);
- ret = open_tty(-1, &vt->real_fd, &vt->real_num);
+ ret = open_tty(vt_for_seat0, &vt->real_fd, &vt->real_num);
if (ret)
return ret;
struct uterm_vt **out,
const char *seat,
struct uterm_input *input,
+ int vt_for_seat0,
uterm_vt_cb cb,
void *data)
{
if (!strcmp(seat, "seat0") && vtm->vt_support) {
vt->mode = UTERM_VT_REAL;
- ret = real_open(vt);
+ ret = real_open(vt, vt_for_seat0);
if (ret)
goto err_sig2;
} else {