Files
Leo 59cf9825d1 fix(t75 ④⑤): 連線精靈不再清空輸入+Windows 不再每幾秒閃 console 視窗
leo 同事真機實測撞到的兩個最嚴重問題。

④ 連線失敗會清空使用者輸入(leo:「很糟糕」)
   真兇:失敗後呼叫 showConnectWizard(),註解寫著「不要把他丟回空白畫面」
   **但行為與註解相反**——它重建整個對話框,urlEntry 是全新的,
   而 cfg.CypherURL 因連線失敗根本沒寫入 ⇒ 欄位就是空的 ⇒ 使用者整段重打。
   修:改 showConnectWizardWith(prevURL, prevEmail) 帶回上次輸入,
   讓他只改錯的那個字。密碼不帶回(打錯時重打較安全,也少留記憶體)。

⑤ daemon 開著時每幾秒閃一個方框(約半螢幕)
   真兇:arcrun-collector.exe 是 console 型執行檔,supervisor 每輪 exec 起它,
   **Windows 預設會為 console 程式配可見視窗** ⇒ 每輪閃一次。
   Mac/Linux 無此概念故開發期完全沒想到。
   修:新增 hidewindow_windows.go(HideWindow + CREATE_NO_WINDOW)
   +hidewindow_other.go(no-op),編譯期分平台不寫 runtime.GOOS 判斷。
   註:-H windowsgui 是連結期選項(管自己有沒有視窗),與此(管起別人時給不給視窗)
   是兩件事,兩者都要做才乾淨。

驗證:Mac 與 Windows 交叉編譯皆 exit=0 且產物生成;collector 全測試綠。
⚠️ 未真機驗——⑤ 的效果必須在真 Windows 上確認方框消失。
2026-07-28 00:42:12 +08:00

11 lines
368 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//go:build !windows
package supervisor
import "os/exec"
// hideChildWindow 在非 Windows 平台是 no-op
// Unix 系沒有「起子行程會配一個視窗」這回事(那是 Windows console subsystem 的行為)。
// 保留同名函式是為了讓 supervisor.go 不必寫 runtime.GOOS 判斷(編譯期就分好)。
func hideChildWindow(_ *exec.Cmd) {}