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 <noreply@anthropic.com>
This commit is contained in:
16
wezterm.lua
16
wezterm.lua
@@ -268,7 +268,12 @@ local function append_ssh_domain(window, pane, name, remote_address, username)
|
|||||||
return
|
return
|
||||||
end
|
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)
|
local updated, count = text:gsub("\n}%s*\n\n%-%- Unix domain", "\n" .. entry .. "}\n\n-- Unix domain", 1)
|
||||||
|
|
||||||
if count == 0 then
|
if count == 0 then
|
||||||
@@ -294,8 +299,13 @@ local function update_ssh_domain(window, pane, old_name, name, remote_address, u
|
|||||||
end
|
end
|
||||||
|
|
||||||
local quoted_old_name = escape_pattern(string.format("%q", old_name))
|
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 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},\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 safe_entry = entry:gsub("%%", "%%%%")
|
local safe_entry = entry:gsub("%%", "%%%%")
|
||||||
|
|
||||||
local updated, count = text:gsub(pattern, safe_entry, 1)
|
local updated, count = text:gsub(pattern, safe_entry, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user