From 084f2cb1930986b043e1dc9432b432a12bf30e38 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 19 Apr 2026 09:23:27 +0300 Subject: [PATCH] tty: Skip initialization if session is inactive --- src/backend/tty.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 684fa374..67ef5a5f 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -519,6 +519,14 @@ impl Tty { } pub fn init(&mut self, niri: &mut Niri) { + // If the session is inactive, skip initialization because we won't be able to do much with + // the devices anyway. We'll get ActivateSession and add the devices there instead. + // + // This can happen when starting niri while having a different TTY active (e.g. via tmux). + if !self.session.is_active() { + return; + } + let udev = self.udev_dispatcher.clone(); let udev = udev.as_source_ref();