Skip to content

Instantly share code, notes, and snippets.

@flurdy
Last active July 10, 2025 11:43
Show Gist options
  • Select an option

  • Save flurdy/ec901ff7cbfbc7ab190e60b52d92d860 to your computer and use it in GitHub Desktop.

Select an option

Save flurdy/ec901ff7cbfbc7ab190e60b52d92d860 to your computer and use it in GitHub Desktop.
Fish Shell function to launch Cursor AI editor
# cursor.fish — Fish Shell function to launch Cursor AI Editor
#
function cursor
# List of possible locations for the Cursor executable
set -l possible_paths \
/usr/bin/cursor \
/usr/local/bin/cursor \
/opt/cursor/cursor \
$HOME/.local/bin/cursor
# Find the first executable Cursor binary
set -l cursor_bin
for path in $possible_paths
if test -x $path
set cursor_bin $path
break
end
end
# Fall back to PATH if not found yet
if not set -q cursor_bin
if type -q cursor
set cursor_bin (command -v cursor)
end
end
# Error out if still not found
if not set -q cursor_bin
echo "Error: Cursor not found in known locations or PATH." >&2
return 1
end
# Launch Cursor quietly in the background
if test (count $argv) -eq 0
nohup $cursor_bin > /dev/null 2>&1 & disown
else
nohup $cursor_bin $argv > /dev/null 2>&1 & disown
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment