From 49cdcb948cdb55cae09ba3643ed97aa2d6410994 Mon Sep 17 00:00:00 2001 From: Kj Tsanaktsidis Date: Fri, 12 Sep 2025 20:16:34 +1000 Subject: fix vt escape --- kj-laptop01/configuration.nix | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/kj-laptop01/configuration.nix b/kj-laptop01/configuration.nix index 354f688..610ecd3 100644 --- a/kj-laptop01/configuration.nix +++ b/kj-laptop01/configuration.nix @@ -110,11 +110,25 @@ programs.zsh.enable = true; # Disable Alt+Left/Right virtual terminal switching - console.keyMap = pkgs.runCommand "disable-vt-switch.map" { - nativeBuildInputs = [ pkgs.kbd ]; - } '' - ${pkgs.kbd}/bin/dumpkeys ${pkgs.kbd}/share/keymaps/i386/qwerty/us.map.gz | \ - sed 's/alt keycode 105 = Console_12/alt keycode 105 = noop/' | \ - sed 's/alt keycode 106 = Console_18/alt keycode 106 = noop/' > $out - ''; + console.keyMap = "us"; + + # Create systemd service to disable only Alt+Arrow VT switching + systemd.services.disable-alt-arrow-vt = { + description = "Disable Alt+Arrow VT switching"; + wantedBy = [ "multi-user.target" ]; + after = [ "systemd-vconsole-setup.service" ]; + script = '' + # Define string sequences for Alt+Arrow that generate proper terminal escape sequences + cat << 'EOF' | ${pkgs.kbd}/bin/loadkeys + string F200 = "\033[1;3D" + string F201 = "\033[1;3C" + alt keycode 105 = F200 + alt keycode 106 = F201 + EOF + ''; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + }; } -- cgit v1.2.3