Make the SSH domain restart warning harder to miss

notify() now accepts an optional duration override; the SSH domain
save/update toasts use it to stay up 10s (vs the default 4s) and lead
with a bold warning that connecting immediately will fail and
wezterm-gui.exe needs a full restart (Task Manager End Task, not just
reload) before the new/edited domain is usable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-18 01:07:24 +09:00
parent 89064e4cc1
commit d87803f89e

View File

@@ -150,9 +150,9 @@ config.unix_domains = {
local is_windows = wezterm.target_triple:find("windows") ~= nil
local config_file = wezterm.config_file or (is_windows and (wezterm.home_dir .. "\\.wezterm.lua") or "/mnt/storage/wezterm.lua")
local function notify(window, message)
local function notify(window, message, duration_ms)
if window.toast_notification then
window:toast_notification("WezTerm", message, nil, 4000)
window:toast_notification("WezTerm", message, nil, duration_ms or 4000)
else
wezterm.log_info(message)
end
@@ -365,7 +365,12 @@ local function append_ssh_domain(window, pane, name, remote_address, username)
return
end
notify(window, "SSH 도메인 저장됨: " .. name .. " -> " .. remote_address .. " (WezTerm을 완전히 재시작해야 연결 목록에 나타납니다)")
notify(
window,
"저장됨: " .. name .. " -> " .. remote_address .. "\n"
.. "⚠ 지금 바로 연결하면 실패합니다. 작업 관리자에서 wezterm-gui.exe를 완전히 종료 후 재시작하세요.",
10000
)
window:perform_action(act.ReloadConfiguration, pane)
end
@@ -398,7 +403,12 @@ local function update_ssh_domain(window, pane, old_name, name, remote_address, u
return
end
notify(window, "SSH 도메인 수정됨: " .. name .. " -> " .. remote_address .. " (WezTerm을 완전히 재시작해야 반영됩니다)")
notify(
window,
"수정됨: " .. name .. " -> " .. remote_address .. "\n"
.. "⚠ 지금 바로 연결하면 실패합니다. 작업 관리자에서 wezterm-gui.exe를 완전히 종료 후 재시작하세요.",
10000
)
window:perform_action(act.ReloadConfiguration, pane)
end