From 4112e3fb03f17149aaf71b93c71e5507444f3e65 Mon Sep 17 00:00:00 2001 From: JiXieShi Date: Sun, 24 May 2026 02:58:41 +0800 Subject: [PATCH] fix: log path format, panel hotkey passthrough, TUI hint styling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix log path default: $s→%s, show available fmt fields in prompt - Panel handlers default return false (allows Ctrl+Alt+M/F/P/H to switch panels without closing current one) - TUI bottom hints: replace Faint with Bold + brighter colors (suggest=cyan, status=bright white, hotkeys=bright gray) Co-Authored-By: Claude Opus 4.7 --- internal/flag/flag.go | 6 +++--- internal/tui/model.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/flag/flag.go b/internal/flag/flag.go index dd5792d..4101d2d 100644 --- a/internal/flag/flag.go +++ b/internal/flag/flag.go @@ -101,7 +101,7 @@ func PrintUsage(ports []string) { {"-k", "--hotkey-mod", "string", "hotkey modifier", "ctrl+alt"}, {"-f", "--forward", "[]int", "forward (0:none,1:TCP,2:UDP,3:TCP-S,4:UDP-S,5:COM)", "0"}, {"-a", "--address", "[]string", "forward address", "127.0.0.1:12345"}, - {"-l", "--log", "string", "log path", "./%s-$s.txt"}, + {"-l", "--log", "string", "log path (%s=port, then timestamp)", "./%s-%s.log"}, {"-t", "--time", "string", "timestamp format", "[06-01-02 15:04:05.000]"}, } sort.Slice(flags, func(i, j int) bool { return flags[i].long < flags[j].long }) @@ -254,9 +254,9 @@ func GetCliFlag(cfg *config.Config) { cfg.EnableLog = e if e { t, _ = inf.NewText( - text.WithPrompt("Path:"), + text.WithPrompt("Path(%s=port, then stamp):"), text.WithPromptStyle(theme.DefaultTheme.PromptStyle), - text.WithDefaultValue("./%s-$s.txt"), + text.WithDefaultValue("./%s-%s.log"), ).Display() cfg.LogFilePath = t } diff --git a/internal/tui/model.go b/internal/tui/model.go index f1917fc..34abaeb 100644 --- a/internal/tui/model.go +++ b/internal/tui/model.go @@ -258,12 +258,13 @@ func (m *Model) View() string { } modifier := strings.ToUpper(normalizeHotkeyPrefix(m.App.Cfg().HotkeyMod)) hotkeys := "Hotkeys: Ctrl+C remote | " + modifier + "+C local | " + modifier + "+F forward | " + modifier + "+P plugins | " + modifier + "+M mode | F1 help" - hotkeys = lipgloss.NewStyle().Faint(true).Foreground(lipgloss.Color("245")).Render(hotkeys) + hotkeys = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("244")).Render(hotkeys) status := m.statusLine if status == "" { status = "Ready" } - status = lipgloss.NewStyle().Foreground(lipgloss.Color("250")).Faint(true).Render(status) + status = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("255")).Render(status) + suggest = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("39")).Render(suggest) base := fmt.Sprintf("%s\n%s\n%s\n%s\n%s", m.viewport.View(), suggest, status, m.input.View(), hotkeys) if !m.showModal { return fillScreen(m.width, m.height, base)