{"record":{"id":"004c10607c12cece","repo":"felixse/FluentTerminal","slug":"command-command-not-found-error-message-e","errorCode":null,"errorMessage":"'${command}' command not found. Error message: ${error}","messagePattern":"'(.+?)' command not found\\. Error message: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"FluentTerminal.SystemTray/FileFinder.cs","lineNumber":84,"sourceCode":"                    if (process.ExitCode == 0)\n                    {\n                        if (string.IsNullOrEmpty(path))\n                        {\n                            throw new Exception(\"Should not happen! 'where' exit code is 0, yet the path is empty.\");\n                        }\n\n                        if (!File.Exists(path))\n                        {\n                            throw new Exception(\n                                \"Should not happen! 'where' returned a path that doesn't exist: \" + path);\n                        }\n\n                        return path;\n                    }\n\n                    if (!string.IsNullOrEmpty(error))\n                    {\n                        throw new Exception($\"'{command}' command not found. Error message: \" + error);\n                    }\n\n                    throw new Exception($\"'{command}' command not found. Exit code: {process.ExitCode:##########}\");\n                }\n            }\n        }\n    }\n}","sourceCodeStart":66,"sourceCodeEnd":92,"githubUrl":"https://github.com/felixse/FluentTerminal/blob/ba83ec485eea8d8ee65825711731300bee2e76ed/FluentTerminal.SystemTray/FileFinder.cs#L66-L92","documentation":"Thrown by FileFinder.GetCommandPath when the Windows `where` utility (used to resolve an executable on PATH) exits non-zero AND writes an error message. The helper shells `where <command>`, captures stdout/stderr; on failure with a non-empty error line it reports the command was not found along with where's error text.","triggerScenarios":"GetCommandPath(\"bash\") (or wsl, mosh, ssh, etc.) runs `where bash`; the executable is not on PATH so where prints 'INFO: Could not find files for the given pattern(s).' and exits non-zero, triggering this branch.","commonSituations":"Requested shell/tool (bash.exe, wsl.exe, git, mosh) is not installed or not on the system PATH; PATH was modified after the app started; the tool is installed only for a different user; running on a system where the dependency was never installed.","solutions":["Install the missing tool and ensure its directory is on the system PATH (restart the app/tray so it inherits the new PATH).","Point the profile's shell Location directly at the executable's full path instead of relying on PATH lookup.","Verify the tool is installed for the same user/architecture the tray process runs under."],"exampleFix":"// before\nif (!string.IsNullOrEmpty(error))\n    throw new Exception($\"'{command}' command not found. Error message: \" + error);\n\n// after - actionable hint pointing the user to install/PATH\nthrow new Exception($\"'{command}' was not found on PATH ({error}). Install it or set the full path in the profile.\");","handlingStrategy":"validation","validationCode":"// Resolve the path yourself and fall back to a configured location.\nstring full = null;\nforeach (var dir in Environment.GetEnvironmentVariable(\"PATH\").Split(Path.PathSeparator))\n    foreach (var ext in new[]{\".exe\",\".bat\",\".cmd\"})\n        if (File.Exists(Path.Combine(dir, command + ext))) { full = Path.Combine(dir, command + ext); break; }\nif (full == null) throw new FileNotFoundException($\"'{command}' not found on PATH\", command);","typeGuard":null,"tryCatchPattern":"try { path = command.GetCommandPath(); }\ncatch (Exception ex) { logger.Warn(ex, \"command not found\"); promptUserForPath(command); }","preventionTips":["Install the required tool and ensure it is on the system PATH; restart the app to inherit PATH.","Set the profile's shell Location to an absolute path to bypass where-lookup.","Verify the tool is installed for the same user/architecture as the tray."],"tags":["process","path-lookup","where","windows","shell"],"backgroundTag":null,"analyzedSha":"ba83ec485eea8d8ee65825711731300bee2e76ed","analyzedAt":"2026-08-13T21:23:15.467Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}