Fix ud and ssh

This commit is contained in:
muon 2026-03-08 15:55:01 +00:00
parent 5518f1ca35
commit c9be88c1b6

View file

@ -207,6 +207,18 @@ in {
end)
end
-- scroll_or_passthrough: Ctrl+key scrolls at the shell prompt but passes
-- the key through when a program has taken the alt screen (vim, less, fzf).
local function scroll_or_passthrough(key, pages)
return wezterm.action_callback(function(window, pane)
if pane:is_alt_screen_active() then
window:perform_action(act.SendKey({ key = key, mods = "CTRL" }), pane)
else
window:perform_action(act.ScrollByPage(pages), pane)
end
end)
end
-- tab_is_zoomed: true if any pane in the current tab is zoomed.
-- Used by move_vertical to decide whether to carry zoom forward.
local function tab_is_zoomed(pane)
@ -382,6 +394,16 @@ in {
}
config.tab_bar_at_bottom = false
-- SSH Domains
config.ssh_domains = {
{
name = "muho",
remote_address = "muho",
username = "muon",
},
}
-- Shell
${lib.optionalString (shell != null) ''
@ -471,9 +493,11 @@ in {
{ key = "t", mods = "ALT", action = act.ShowTabNavigator },
-- Alt+q: quit
{ key = "q", mods = "ALT", action = act.QuitApplication },
-- Ctrl+U/D: scroll half page (matches Alacritty)
{ key = "u", mods = "CTRL", action = act.ScrollByPage(-0.5) },
{ key = "d", mods = "CTRL", action = act.ScrollByPage(0.5) },
-- Ctrl+U/D: scroll half page when at the shell prompt; pass through
-- to the running program when it is using the alt screen (vim, less,
-- fzf, etc. switch to the alt screen and need the raw key).
{ key = "u", mods = "CTRL", action = scroll_or_passthrough("u", -0.5) },
{ key = "d", mods = "CTRL", action = scroll_or_passthrough("d", 0.5) },
-- Copy / paste
{ key = "c", mods = "CTRL|SHIFT", action = act.CopyTo("Clipboard") },
{ key = "v", mods = "CTRL|SHIFT", action = act.PasteFrom("Clipboard") },