fix: keep cursor shim working in AppImage terminals#21
fix: keep cursor shim working in AppImage terminals#21ZanzyTHEbar wants to merge 4 commits intowatzon:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e669bc8a1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
scripts/ensure-shell-path.sh
Outdated
| return 0 | ||
| fi | ||
|
|
||
| mv "$tmp" "$file" |
There was a problem hiding this comment.
Preserve symlinked shell rc files when writing PATH hook
Using mv "$tmp" "$file" here replaces the rc file path itself, which breaks users who keep ~/.bashrc/~/.zshrc as symlinks to dotfile-managed files. In that common setup, install/update (and similarly remove_block) will silently convert the symlink into a standalone file, so future dotfile updates no longer apply. This is a functional regression for symlink-based shell configs and should be handled with an in-place write strategy that preserves links.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Handled in 8945586. scripts/ensure-shell-path.sh now writes through existing rc file paths instead of replacing them, so symlinked ~/.bashrc/~/.zshrc targets stay intact during both install/update and removal. I also rebuilt the PR branch on top of upstream/main and force-pushed the cleaned history.
Cursor-launched shells can put AppImage runtime mounts ahead of ~/.local/bin, which bypasses the shim and breaks agent and installer flows. Manage shell PATH setup and tighten shim detection so installs remain idempotent regardless of install order.
Update the PATH hook helper in place when an rc file already exists so dotfile-managed symlinks keep pointing at their original targets during install and removal.
4e669bc to
8945586
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89455866f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| log_info "To add it, run this or add it to your shell profile:" | ||
| log_info "export PATH=\"\$HOME/.local/bin:\$PATH\"" | ||
| fi | ||
| warn_if_cursor_shadowed_by_appimage_runtime |
There was a problem hiding this comment.
Bundle or refresh lib before invoking shell-path helpers
This new call is unconditional, but install.sh still prefers an existing ~/.local/share/cursor-installer/lib.sh when run standalone (the common curl ... | bash path). On systems upgrading from pre-change installs, that older lib does not define the new shell-path functions, so the installer exits with command not found here after already replacing ~/.local/bin/cursor-installer, leaving users in a partially upgraded/broken state. Ensure the script refreshes/copies the latest lib.sh before using new helper APIs, or defensively gate the call when the function is missing.
Useful? React with 👍 / 👎.
| # Remove shared lib (installed by installer) | ||
| # Remove managed shell PATH setup before deleting helper assets | ||
| log_step "Removing managed shell PATH setup..." | ||
| run_remove_shell_path |
There was a problem hiding this comment.
Guard uninstall path cleanup when helper API is absent
Uninstall now assumes run_remove_shell_path exists in the sourced lib, but uninstall.sh can source an already-installed older lib.sh that predates this API. In that upgrade scenario, uninstall aborts with command not found at this line and stops cleanup early. Please add a compatibility guard (or refresh lib.sh first) so uninstall remains usable across mixed script/lib versions.
Useful? React with 👍 / 👎.
The shim should route `cursor agent ...` into the agent binary without forwarding the `agent` dispatcher token itself. Shift the subcommand before exec so the agent CLI receives only its own arguments.
Repeated installs should not rewrite shell rc files with extra blank lines or lose track of the intended destination variables. Trim trailing separator whitespace before re-appending the managed block and avoid leaking helper-local variable names across functions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fc8394997
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| function update_cursor() { | ||
| log_step "Updating Cursor..." | ||
| refresh_shim_assets | ||
| refresh_shell_path_assets |
There was a problem hiding this comment.
Gate shell-path refresh calls on lib API availability
update_cursor now calls refresh_shell_path_assets unconditionally, but installed environments can still source an older ~/.local/share/cursor-installer/lib.sh that predates this API. In that mixed-version state, cursor-installer --update exits with command not found before any update logic runs, so users are left with a broken updater until lib assets are manually repaired. Add a compatibility guard (or force-refresh lib.sh) before invoking new helper functions.
Useful? React with 👍 / 👎.
| shell_name=$(basename "${SHELL:-}") | ||
| case "$shell_name" in | ||
| bash) | ||
| printf '%s\n' "$HOME/.bashrc" |
There was a problem hiding this comment.
Remove PATH hook from all managed shell rc files
print_target_files derives exactly one target rc file from the current $SHELL, and uninstall reuses this default selection. If the PATH hook was added from a different shell earlier (for example, install from bash but uninstall from zsh), cleanup skips the original file and leaves the managed block behind, so uninstall does not fully remove the feature it installed.
Useful? React with 👍 / 👎.
|
This is a WIP - be ready soon. |
Summary
cursorresolving to~/.local/bin/cursorin supported shells even when AppImage runtime paths are injected ahead of itTest plan
cursor agentbehavior