From da9f4f70e60cadef4b7ad807cd2660e2704b9746 Mon Sep 17 00:00:00 2001 From: gm Date: Sat, 18 Jul 2026 01:00:39 +0900 Subject: [PATCH] Default new SSH domains to multiplexing = "None" Without it, WezTerm tries to run its own mux protocol over the SSH session (spawning `wezterm cli --prefer-mux proxy` on the remote), which fails with "Please install the same version of wezterm on both the client and server" whenever the remote host doesn't have wezterm installed -- the case for a plain SSH target. multiplexing = "None" makes the domain behave like a normal SSH terminal instead. update_ssh_domain's match pattern is now a lazy "match to the next closing brace" instead of assuming an exact 3-field shape, so it can still find and replace entries saved before this change (without the multiplexing field) as well as ones saved after. Co-Authored-By: Claude Sonnet 5 --- wezterm.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/wezterm.lua b/wezterm.lua index 7a97206..defbb9d 100644 --- a/wezterm.lua +++ b/wezterm.lua @@ -268,7 +268,12 @@ local function append_ssh_domain(window, pane, name, remote_address, username) return end - local entry = string.format('\t{\n\t\tname = %q,\n\t\tremote_address = %q,\n\t\tusername = %q,\n\t},\n', name, remote_address, username) + local entry = string.format( + '\t{\n\t\tname = %q,\n\t\tremote_address = %q,\n\t\tusername = %q,\n\t\tmultiplexing = "None",\n\t},\n', + name, + remote_address, + username + ) local updated, count = text:gsub("\n}%s*\n\n%-%- Unix domain", "\n" .. entry .. "}\n\n-- Unix domain", 1) if count == 0 then @@ -294,8 +299,13 @@ local function update_ssh_domain(window, pane, old_name, name, remote_address, u end local quoted_old_name = escape_pattern(string.format("%q", old_name)) - local pattern = "\t{\n\t\tname = " .. quoted_old_name .. ",\n\t\tremote_address = %b\"\",\n\t\tusername = %b\"\",\n\t},\n" - local entry = string.format('\t{\n\t\tname = %q,\n\t\tremote_address = %q,\n\t\tusername = %q,\n\t},\n', name, remote_address, username) + local pattern = "\t{\n\t\tname = " .. quoted_old_name .. ",\n.-\n\t},\n" + local entry = string.format( + '\t{\n\t\tname = %q,\n\t\tremote_address = %q,\n\t\tusername = %q,\n\t\tmultiplexing = "None",\n\t},\n', + name, + remote_address, + username + ) local safe_entry = entry:gsub("%%", "%%%%") local updated, count = text:gsub(pattern, safe_entry, 1)