Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion open_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ func revealFile(path string) error {
// runExplorer fires Explorer and deliberately ignores its exit code:
// explorer.exe famously exits 1 even on success. openPath has already
// verified the target exists, which is the error case we care about.
//
// Do NOT set HideWindow here: Explorer honors the STARTF_USESHOWWINDOW /
// SW_HIDE hint and opens the folder window invisible.
func runExplorer(cmdLine string) error {
cmd := exec.Command("explorer.exe")
cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: cmdLine, HideWindow: true}
cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: cmdLine}
if err := cmd.Start(); err != nil {
return fmt.Errorf("start explorer: %w", err)
}
Expand Down
Loading