You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: keep AppImage terminals resolving to the cursor shim
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.
Copy file name to clipboardExpand all lines: README.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,8 @@ The one‑liner script will:
44
44
2. Download `lib.sh` to `~/.local/share/cursor-installer/lib.sh`
45
45
3. Make the script executable
46
46
4. Install a `cursor` shim at `~/.local/bin/cursor` (see [The `cursor` Shim](#the-cursor-shim))
47
-
5. Download and install the latest version of Cursor
47
+
5. Install a managed shell startup hook for supported shells so `~/.local/bin` stays ahead of transient AppImage runtime paths
48
+
6. Download and install the latest version of Cursor
48
49
49
50
**Note:** If you're installing via the piped bash method and don't have FUSE2 installed, the script will warn you but continue. You'll need to either:
50
51
@@ -125,7 +126,8 @@ The uninstall script will:
125
126
1. Remove the `cursor-installer` script from `~/.local/bin/`
126
127
2. Remove the shared `lib.sh` from `~/.local/share/cursor-installer/`
127
128
3. Remove the Cursor AppImage
128
-
4. Ask if you want to remove the Cursor configuration files
129
+
4. Remove the managed shell PATH hook from supported shell startup files
130
+
5. Ask if you want to remove the Cursor configuration files
129
131
130
132
**Note:** The `cursor` shim at `~/.local/bin/cursor` is not removed by the uninstall script. See [Removing the Shim](#removing-the-shim) for manual cleanup.
131
133
@@ -211,12 +213,19 @@ The shim bridges that gap. It installs a lightweight script at `~/.local/bin/cur
211
213
212
214
When you type `cursor`, the shim (`~/.local/bin/cursor`) follows a short resolution chain:
213
215
214
-
1.**Real Cursor binary found in PATH?** -- Forward all arguments to it (e.g. Cursor's official `cursor` CLI).
215
-
2.**`cursor agent` subcommand?** -- Delegate to `~/.local/bin/agent` if it exists.
216
-
3.**`cursor-installer` found?** -- Delegate to the installer CLI so commands like `cursor --update` still work.
217
-
4.**Nothing found** -- Print a helpful error with install instructions.
216
+
1.**`cursor agent` subcommand?** -- Delegate to `~/.local/bin/agent` if it exists.
217
+
2.**Installer-only flag?** -- Delegate to `cursor-installer` for commands like `cursor --update`, `cursor --check`, or `cursor --extract`.
218
+
3.**Stable Cursor binary found in PATH?** -- Forward all other arguments to it (e.g. Cursor's official `cursor` CLI).
219
+
4.**`cursor-installer` found?** -- Delegate to the installer CLI as a general fallback.
220
+
5.**Nothing found** -- Print a helpful error with install instructions.
218
221
219
-
The shim never hides a real Cursor binary; it only acts as a fallback.
222
+
The shim does not override a stable Cursor CLI, but it deliberately ignores transient AppImage mount paths under `/tmp/.mount_*` and normalizes duplicate path aliases so it cannot recurse back into itself.
223
+
224
+
### AppImage Terminals
225
+
226
+
When Cursor is launched from an AppImage, terminals opened inside Cursor may inherit a `PATH` where Cursor's transient runtime mount (`/tmp/.mount_*`) appears before `~/.local/bin`. That can bypass the shim entirely.
227
+
228
+
To keep `cursor` resolving to the shim in supported shells, the installer manages a small startup hook that prepends `~/.local/bin` in interactive `bash` and `zsh` sessions. This keeps the shim available while still allowing it to delegate to a real Cursor CLI when appropriate.
220
229
221
230
### How It Works
222
231
@@ -241,6 +250,7 @@ The shim is synced automatically during normal installer operations:
241
250
-**`install.sh`** -- Copies `shim.sh` and `ensure-shim.sh` into `~/.local/share/cursor-installer/`, then runs `ensure-shim.sh`.
242
251
-**`cursor-installer --update`** -- Re-downloads the latest shim assets from GitHub, then re-runs `ensure-shim.sh`.
243
252
-**`cursor-installer` (install paths)** -- Runs `ensure-shim.sh` before each install to keep the shim current.
253
+
-**Shell PATH setup** -- Syncs `shell-path.sh` and `ensure-shell-path.sh`, then ensures supported shell startup files source the PATH helper.
244
254
245
255
### File Locations
246
256
@@ -249,6 +259,8 @@ The shim is synced automatically during normal installer operations:
249
259
|`~/.local/bin/cursor`| The shim (what you invoke). |
250
260
|`~/.local/share/cursor-installer/shim.sh`| Cached copy of the shim source. |
251
261
|`~/.local/share/cursor-installer/ensure-shim.sh`| Cached copy of the installer helper. |
262
+
|`~/.local/share/cursor-installer/shell-path.sh`| Shell snippet that prepends `~/.local/bin`. |
263
+
|`~/.local/share/cursor-installer/ensure-shell-path.sh`| Helper that updates supported shell startup files. |
252
264
253
265
### Removing the Shim
254
266
@@ -264,7 +276,7 @@ If you only want to disable the shim without uninstalling the rest of the projec
264
276
265
277
## Note
266
278
267
-
If you encounter a warning that `~/.local/bin` is not in your PATH, you can add it by running:
279
+
If you encounter a warning that `~/.local/bin` is not in your PATH, or if `cursor` resolves to Cursor's transient AppImage runtime instead of the shim, prepend it by running:
0 commit comments