Repository navigation
fix(linux): give hooks the same PATH as custom commands - #61
Conversation
LinuxHooks built the hook child's PATH with the shared macOS CommandPath.widened, while keymap custom commands use LinuxCommandPath, which appends ~/.local/bin. A hook command installed only in ~/.local/bin was therefore found by a custom command but not by a hook. Move the hook environment assembly into LinuxHookEnvironment and use LinuxCommandPath there, with the bundled CLI directory resolved from /proc/self/exe as for custom commands. Event fields and the GDK environment restore are unchanged. Tests: the environment carries the event fields and the custom-command PATH; a real /bin/sh lookup finds a helper placed only in an isolated ~/.local/bin, and the previous shared PATH misses it (exit 127). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BdkWyAeuohRJ3imTJDuXXs
|
Hi @melonamin, a short heads-up rather than a request. Since linux-port has been quiet since Nov 8, our fork (https://github.com/alexandru-savinov/agterm-omarchy) is going to keep the Linux GUI maintained for Omarchy users:
If you pick linux-port up again, we'd gladly merge your work back and offer our Linux fixes to you as PRs. That includes this one, and the HTML bridge, frame navigation and app-tick fixes. If you'd prefer we change the ID or the naming, just say so and we will. (Prepared with Claude Code; reviewed and posted by me.) |
|
Follow-up to my note above: the Omarchy package request is now up (omacom/omarchy-pkgs#3184, draft PR omacom/omarchy-pkgs#3268). As promised, it ships as Prepared and posted with AI assistance (Claude Code) on my behalf. |
|
Hi @melonamin, following up on my earlier offer here to send our general Linux fixes back as PRs. These three are merged in agterm-omarchy and all are in release 0.43.0.13. Tell me which you'd like, and I'll open one PR per fix against
No pressure. If none of them fit linux-port, that's fine too. Prepared and posted with AI assistance (Claude Code) on my behalf. |
Linux hooks and keymap custom commands look up executables on different PATHs.
LinuxHooksbuilds the hook's PATH with the shared macOSCommandPath.widened, which appends/usr/local/binand/opt/homebrew/bin. The custom-command runner usesLinuxCommandPath, which also appends~/.local/bin. With a minimal GUI PATH, a helper installed only in~/.local/binis found by a custom command but not by a hook. The hook's shell exits 127 and the hook reports a failure.Fix: the hook environment is now built in
LinuxHookEnvironment.make, which usesLinuxCommandPathas custom commands do. The bundled CLI directory now comes from/proc/self/exeinstead ofargv[0]. TheAGT_*event variables and the GDK environment restore are unchanged.Test:
LinuxHookEnvironmentTestschecks that the environment carries the event fields and the custom-command PATH. It also runs a real/bin/sh -clookup of a helper placed only in an isolated~/.local/bin. The lookup succeeds with the new PATH. The previous shared PATH exits 127, so the test can fail.Validation: I ran this branch through the linux-port CI on my fork, with workflow_dispatch added on a separate branch: https://github.com/alexandru-savinov/agterm-omarchy/actions/runs/43308641188.
swift test (agterm-linux)passed 636 tests, including the new "Linux hook environment" suite. The GTK build, 72 AT-SPI smoke scenarios, the unit tests and whole-tree strict SwiftLint also passed. The run's SwiftLint job is red only because of the published-release verifier fixture, which expectsGITHUB_REPOSITORY=melonamin/agterm-linuxand so fails in any fork.This was prepared with AI assistance (Claude). I reviewed the change. It has not been exercised in a live GTK session with a real hook.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BdkWyAeuohRJ3imTJDuXXs