getcursor / cursor

The AI Code Editor
https://cursor.com
25.8k stars 1.6k forks source link

Installing Cursor CLI fails on Linux #796

Open worldofgeese opened 1 year ago

worldofgeese commented 1 year ago

On Clear Linux*, the Cursor AppImage fails to install the CLI tool on first-run. Opening the command palette to attempt a manual CLI install as suggested here fails to find an install cursor command.

Cursor itself opens fine, it's just the CLI install that fails. Are there manual steps I can perform to resolve?

pathikg commented 1 year ago

Any update on this issue?

lazyeasydev commented 1 year ago

If y'all want a temp fix. I just added this to my .zshrc

cursor() {
    local appimage_path=$(ls ~/Desktop/cursor-*.AppImage | sort -V | tail -n 1)
    if [[ -f $appimage_path ]]; then
        "$appimage_path" "$@" > /dev/null 2>&1 &
    else
        echo "Cursor AppImage not found on the Desktop."
    fi
}

Just change the path if you aren't running from your desktop directory.

bluet commented 12 months ago

I have the same issue yesterday when installing cursor on my Ubuntu desktop. Any further info from dev team?

timcharper commented 3 months ago

this seems to work well enough for me. (I personally need --no-sandbox due to Ubuntu 24.04 SUID change and the difficulty of setting a permission bit on a file inside of an app image.)

#!/bin/bash

# Function to find the cursor path
find_cursor_path() {
    find /tmp -maxdepth 1 -name ".mount_*" -exec find {} -maxdepth 1 -name "cursor" \; 2>/dev/null | head -n 1
}

# Call the function to find the cursor path
CURSOR_PATH=$(find_cursor_path)

if [ -n "$CURSOR_PATH" ]; then
    # If cursor exists, run it with the arguments passed to this script
    "$CURSOR_PATH" --no-sandbox "$@"
else
    # If cursor doesn't exist, launch cursor.desktop and wait for CURSOR_PATH to show up
    gtk-launch cursor.desktop

    # Loop to wait for CURSOR_PATH to show up
    while [ -z "$CURSOR_PATH" ]; do
        sleep 1
        CURSOR_PATH=$(find_cursor_path)
    done

    # Run the command once CURSOR_PATH is found
    "$CURSOR_PATH" --no-sandbox "$@"
fi