{"record":{"id":"e0ed6dfdc471f13d","repo":"wavetermdev/waveterm","slug":"error-writing-fish-integration-wave-fish-v","errorCode":null,"errorMessage":"error writing fish-integration wave.fish: %v","messagePattern":"error writing fish-integration wave\\.fish: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/util/shellutil/shellutil.go","lineNumber":419,"sourceCode":"\terr = utilfn.WriteTemplateToFile(filepath.Join(zshDir, \".zlogin\"), ZshStartup_Zlogin, params)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing zsh-integration .zlogin: %v\", err)\n\t}\n\terr = utilfn.WriteTemplateToFile(filepath.Join(zshDir, \".zshenv\"), ZshStartup_Zshenv, params)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing zsh-integration .zshenv: %v\", err)\n\t}\n\terr = utilfn.WriteTemplateToFile(filepath.Join(bashDir, \".bashrc\"), BashStartup_Bashrc, params)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing bash-integration .bashrc: %v\", err)\n\t}\n\terr = os.WriteFile(filepath.Join(bashDir, \"bash_preexec.sh\"), []byte(BashStartup_Preexec), 0644)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing bash-integration bash_preexec.sh: %v\", err)\n\t}\n\terr = utilfn.WriteTemplateToFile(filepath.Join(fishDir, \"wave.fish\"), FishStartup_Wavefish, params)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing fish-integration wave.fish: %v\", err)\n\t}\n\terr = utilfn.WriteTemplateToFile(filepath.Join(pwshDir, \"wavepwsh.ps1\"), PwshStartup_wavepwsh, params)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing pwsh-integration wavepwsh.ps1: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc initCustomShellStartupFilesInternal() error {\n\tlog.Printf(\"initializing wsh and shell startup files\\n\")\n\twaveDataHome := wavebase.GetWaveDataDir()\n\tbinDir := filepath.Join(waveDataHome, WaveHomeBinDir)\n\terr := InitRcFiles(waveDataHome, binDir)\n\tif err != nil {\n\t\treturn err\n\t}\n","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/util/shellutil/shellutil.go#L401-L437","documentation":"InitRcFiles wraps a failure from utilfn.WriteTemplateToFile when rendering wave.fish into the fish-integrations directory. Like the other rc-write errors, the cause is an OS-level write failure or template error; the original error is embedded via %v. Fish blocks will lack the Wave integration script.","triggerScenarios":"InitRcFiles / InstallRcFiles reaching the wave.fish write step while <fishDir> is unwritable, missing, or the template params cannot render (e.g. quoting issue in WSHBINDIR).","commonSituations":"Fish integration dir removed by cleanup scripts; read-only container layers; permission drift when multiple user accounts run Wave against a shared home.","solutions":["Make the fish-integrations directory writable by the current user (chown/chmod).","Delete the fish-integrations dir and rerun initialization so Wave recreates it.","Verify free disk space and that the volume is mounted read-write.","Examine the wrapped error for the precise OS-level cause."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify fish-integrations dir exists and is writable\nif fi, err := os.Stat(fishDir); err != nil || !fi.IsDir() {\n\tif err := os.MkdirAll(fishDir, 0755); err != nil { return err }\n}\nprobe := filepath.Join(fishDir, \".probe\")\nif err := os.WriteFile(probe, nil, 0644); err != nil { return err }\nos.Remove(probe)","typeGuard":null,"tryCatchPattern":"err := shellutil.InitRcFiles(home, binDir)\nif err != nil && strings.Contains(err.Error(), \"fish-integration wave.fish\") {\n\tlog.Printf(\"fish rc write failed: %v — resetting dir\", err)\n\tos.RemoveAll(fishDir)\n\treturn shellutil.InitRcFiles(home, binDir)\n}","preventionTips":["Don't manually edit files in the fish-integrations dir; they are regenerated and manual ownership changes break writes.","Check disk quotas in shared-hosting environments.","Fix ownership drift immediately if multiple accounts share a home dir.","Log the wrapped cause to distinguish permission vs space issues."],"tags":["filesystem","shell-integration","fish","file-write"],"backgroundTag":"file-write-permission-denied","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}