You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is in openFileWithEditor() / openDirectoryWithEditor()
On windows it should launch default handler app for a file like e.g.:
cmd:=exec.Command("cmd", "/c", "start", absPath)
iferr:=cmd.Run(); err!=nil {
returnfmt.Errorf("failed to open file: %w", err)
}
or:
verb:=windows.StringToUTF16Ptr("open")
file:=windows.StringToUTF16Ptr(absPath)
// ShellExecute returns an instance handle, but we don't need itret, err:=windows.ShellExecute(0, verb, file, nil, nil, windows.SW_SHOW)
ifret<=32 { // According to Windows API documentation, return values <= 32 indicate an erroriferr!=nil {
returnfmt.Errorf("failed to open file: %w", err)
}
returnfmt.Errorf("failed to open file: error code %d", ret)
}
For folders it's more tricky because the default handler would be file explorer, not an editor.
One option is to detect handler for .txt files by reading registry and launch that program with directory but not editor support directory. E.g. notepad doesn't handle directories but vscode does.
Describe the bug
Windows cannot open any files or folders
To Reproduce
Run spf, find a folder, use the E shortcut key to not open
Expected behavior
Open this folder using a file manager
System information (please complete the following information):
The text was updated successfully, but these errors were encountered: