chore: import Local-Cursor v1.1.8 source snapshot

Includes the current working directory changes. Historical commits and release binaries are excluded to limit Gitea storage.
Source base: d7515973fbfd6dd2001fa156c483455b8081c7cb
This commit is contained in:
FuDie0915
2026-11-10 01:24:28 +08:00
commit db73cf5a39
337 changed files with 147502 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
//go:build !windows
// Package winexec 非 Windows 平台直接透传 exec.Command。
package winexec
import "os/exec"
// Command 等价于 exec.Command。
func Command(name string, args ...string) *exec.Cmd {
return exec.Command(name, args...)
}
// Hide 非 Windows 平台无需处理。
func Hide(cmd *exec.Cmd) *exec.Cmd {
return cmd
}

View File

@@ -0,0 +1,26 @@
//go:build windows
// Package winexec 提供 Windows 下隐藏控制台窗口的子进程启动。
// GUI 程序直接 exec.Command 会在每次调用时闪现控制台窗口。
package winexec
import (
"os/exec"
"syscall"
)
// creationFlags 组合 CREATE_NO_WINDOW,避免子进程弹出控制台。
const creationFlags = 0x08000000
// Command 等价于 exec.Command,但在 Windows 上隐藏子进程窗口。
func Command(name string, args ...string) *exec.Cmd {
cmd := exec.Command(name, args...)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true, CreationFlags: creationFlags}
return cmd
}
// Hide 配置一个已有的 exec.Cmd 隐藏窗口(用于 CommandContext 等场景)。
func Hide(cmd *exec.Cmd) *exec.Cmd {
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true, CreationFlags: creationFlags}
return cmd
}