diff options
-rw-r--r-- | src/kmscon_seat.c | 6 | ||||
-rw-r--r-- | src/kmscon_terminal.c | 8 | ||||
-rw-r--r-- | src/kmscon_terminal.h | 6 |
3 files changed, 15 insertions, 5 deletions
diff --git a/src/kmscon_seat.c b/src/kmscon_seat.c index 8a259b9..9565f49 100644 --- a/src/kmscon_seat.c +++ b/src/kmscon_seat.c @@ -614,7 +614,8 @@ static void seat_input_event(struct uterm_input *input, ev->handled = true; if (!seat->conf->session_control) return; - ret = kmscon_terminal_register(&s, seat); + ret = kmscon_terminal_register(&s, seat, + uterm_vt_get_num(seat->vt)); if (ret == -EOPNOTSUPP) { log_notice("terminal support not compiled in"); } else if (ret) { @@ -791,7 +792,8 @@ void kmscon_seat_startup(struct kmscon_seat *seat) } if (seat->conf->terminal_session) { - ret = kmscon_terminal_register(&s, seat); + ret = kmscon_terminal_register(&s, seat, + uterm_vt_get_num(seat->vt)); if (ret == -EOPNOTSUPP) log_notice("terminal support not compiled in"); else if (ret) diff --git a/src/kmscon_terminal.c b/src/kmscon_terminal.c index 740a27c..482d50f 100644 --- a/src/kmscon_terminal.c +++ b/src/kmscon_terminal.c @@ -580,7 +580,7 @@ static void write_event(struct tsm_vte *vte, const char *u8, size_t len, } int kmscon_terminal_register(struct kmscon_session **out, - struct kmscon_seat *seat) + struct kmscon_seat *seat, unsigned int vtnr) { struct kmscon_terminal *term; int ret; @@ -646,6 +646,12 @@ int kmscon_terminal_register(struct kmscon_session **out, if (ret) goto err_pty; + if (vtnr > 0) { + ret = kmscon_pty_set_vtnr(term->pty, vtnr); + if (ret) + goto err_pty; + } + ret = ev_eloop_new_fd(term->eloop, &term->ptyfd, kmscon_pty_get_fd(term->pty), EV_READABLE, pty_event, term); diff --git a/src/kmscon_terminal.h b/src/kmscon_terminal.h index 9035b72..9c6a373 100644 --- a/src/kmscon_terminal.h +++ b/src/kmscon_terminal.h @@ -40,12 +40,14 @@ #ifdef BUILD_ENABLE_SESSION_TERMINAL int kmscon_terminal_register(struct kmscon_session **out, - struct kmscon_seat *seat); + struct kmscon_seat *seat, + unsigned int vtnr); #else /* !BUILD_ENABLE_SESSION_TERMINAL */ static inline int kmscon_terminal_register(struct kmscon_session **out, - struct kmscon_seat *seat) + struct kmscon_seat *seat, + unsigned int vtnr) { return -EOPNOTSUPP; } |