diff --git a/kernel/util/working.go b/kernel/util/working.go index f5c99990c..c72cafcc6 100644 --- a/kernel/util/working.go +++ b/kernel/util/working.go @@ -194,6 +194,13 @@ func initWorkspaceDir(workspaceArg string) { } defaultWorkspaceDir := filepath.Join(HomeDir, "Documents", "SiYuan") + if gulu.OS.IsWindows() { + // 改进 Windows 端默认工作空间路径 https://github.com/siyuan-note/siyuan/issues/5622 + if userProfile := os.Getenv("USERPROFILE"); "" != userProfile { + defaultWorkspaceDir = filepath.Join(userProfile, "Documents", "SiYuan") + } + } + var workspacePaths []string if !gulu.File.IsExist(workspaceConf) { WorkspaceDir = defaultWorkspaceDir