fix: resolve spawn python ENOENT error on Linux by using getAugmentedEnv() (#281)

- Use getAugmentedEnv() in project-context-handlers.ts to ensure Python is in PATH
- Add /usr/bin and /usr/sbin to Linux paths in env-utils.ts for system Python
- Fixes GUI-launched apps not inheriting shell environment on Ubuntu 24.04

Fixes #215

Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com>
This commit is contained in:
Todd W. Bucy
2025-12-25 15:26:04 -06:00
committed by GitHub
parent 0b874d4b33
commit d98e28305d
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -26,8 +26,10 @@ const COMMON_BIN_PATHS: Record<string, string[]> = {
],
linux: [
'/usr/local/bin',
'/usr/bin', // System binaries (Python, etc.)
'/snap/bin', // Snap packages
'~/.local/bin', // User-local binaries
'/usr/sbin', // System admin binaries
],
win32: [
// Windows usually handles PATH better, but we can add common locations
@@ -22,6 +22,7 @@ import {
} from './memory-status-handlers';
import { loadFileBasedMemories } from './memory-data-handlers';
import { findPythonCommand, parsePythonCommand } from '../../python-detector';
import { getAugmentedEnv } from '../../env-utils';
/**
* Load project index from file
@@ -187,7 +188,7 @@ export function registerProjectContextHandlers(
'--output', indexOutputPath
], {
cwd: project.path,
env: { ...process.env }
env: getAugmentedEnv()
});
proc.stdout?.on('data', (data) => {