From 267be620cfd88207cff0156d48ebf7b4d245f6d6 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 10 Feb 2026 15:22:58 +0100 Subject: [PATCH] feat(nix): enhance WezTerm and Fish configuration - Enabled scroll bar and added conditional fullscreen key handling in `wezterm.lua` for better usability. - Updated Fish shell to set global `LESS` mouse support for improved navigation. --- homes/x86_64-linux/harald@amd/default.nix | 21 +++++++++++++++++++++ modules/home/cli-apps/fish/default.nix | 1 + 2 files changed, 22 insertions(+) diff --git a/homes/x86_64-linux/harald@amd/default.nix b/homes/x86_64-linux/harald@amd/default.nix index e1694ab..963bdb8 100644 --- a/homes/x86_64-linux/harald@amd/default.nix +++ b/homes/x86_64-linux/harald@amd/default.nix @@ -75,8 +75,29 @@ xdg.configFile."wezterm/wezterm.lua".text = '' local wezterm = require("wezterm") local config = wezterm.config_builder() + local act = wezterm.action config.enable_kitty_keyboard = true + config.enable_scroll_bar = true + + local function action_unless_fullscreen(action, key) + return wezterm.action_callback(function(win, pane) + if pane:is_alt_screen_active() then + -- a program is full screen, passthrough the key + win:perform_action(act.SendKey { key = key, mods = 'NONE' }, pane) + else + -- do the action + win:perform_action(action, pane) + end + end) + end + + -- config.keys = { + -- { key = 'PageUp', mods = 'NONE', action = action_unless_fullscreen(act.ScrollByPage(-0.5), 'PageUp') }, + -- { key = 'PageDown', mods = 'NONE', action = action_unless_fullscreen(act.ScrollByPage(0.5), 'PageDown') }, + -- } + + config.term = 'wezterm' return config ''; diff --git a/modules/home/cli-apps/fish/default.nix b/modules/home/cli-apps/fish/default.nix index b30d727..36e10b8 100644 --- a/modules/home/cli-apps/fish/default.nix +++ b/modules/home/cli-apps/fish/default.nix @@ -19,6 +19,7 @@ in enable = true; interactiveShellInit = '' set fish_greeting # Disable greeting + set -gx LESS '--mouse' function msh --wraps mosh --description 'mosh with tmux' if not set -q argv[1] echo 'Usage: msh [user@]host [command]'