From d4daab7cf62f6b467aa7608ae455a2eb33ff1d96 Mon Sep 17 00:00:00 2001 From: gm Date: Sat, 18 Jul 2026 00:43:50 +0900 Subject: [PATCH] Restructure main menu: connections on top, settings at the bottom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Main menu now lists each registered config.ssh_domains entry as a choice (selecting one spawns a tab attached to that SSH domain via SpawnTab), with a single "설정" entry below them that opens what used to be the main menu (font/connection/other settings, launcher, reload) -- renamed to show_settings_menu. Co-Authored-By: Claude Sonnet 5 --- wezterm.lua | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/wezterm.lua b/wezterm.lua index 6a7fab5..ff93e13 100644 --- a/wezterm.lua +++ b/wezterm.lua @@ -368,10 +368,10 @@ local function show_other_settings(window, pane) ) end -local function show_main_menu(window, pane) +local function show_settings_menu(window, pane) window:perform_action( act.InputSelector({ - title = "메인 메뉴", + title = "설정", fuzzy = true, choices = { { label = "폰트 설정", id = "font" }, @@ -405,6 +405,41 @@ local function show_main_menu(window, pane) ) end +-- 메인 메뉴: 등록된 SSH 연결들을 맨 위에, 설정 항목은 맨 아래에 배치 +local function show_main_menu(window, pane) + local choices = {} + + for _, domain in ipairs(config.ssh_domains or {}) do + table.insert(choices, { + label = domain.name .. " (" .. domain.remote_address .. ")", + id = "domain:" .. domain.name, + }) + end + + table.insert(choices, { label = "설정", id = "settings" }) + + window:perform_action( + act.InputSelector({ + title = "메인 메뉴", + fuzzy = true, + choices = choices, + action = wezterm.action_callback(function(inner_window, inner_pane, id) + if not id then + return + end + + local domain_name = id:match("^domain:(.+)$") + if domain_name then + inner_window:perform_action(act.SpawnTab({ DomainName = domain_name }), inner_pane) + elseif id == "settings" then + show_settings_menu(inner_window, inner_pane) + end + end), + }), + pane + ) +end + wezterm.on("show-main-menu", function(window, pane) show_main_menu(window, pane) end)