Skip to content

Instantly share code, notes, and snippets.

@toml01
Created September 5, 2024 14:22
Show Gist options
  • Save toml01/b413bd736562a5dd6f3d2754ff24facc to your computer and use it in GitHub Desktop.
Save toml01/b413bd736562a5dd6f3d2754ff24facc to your computer and use it in GitHub Desktop.
Automate cursor symlink fix for WSL (building on top of @swayducky 's great gist!)
#! /bin/bash
# HOW TO INSTALL:
# 1) Save this script as cursor_fix.sh
# 2) chmod +x cursor_fix.sh
# 3) ./cursor_fix.sh
wget -O cursor_fix_template https://gist.githubusercontent.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4/raw/6c3a3c0be667ed487de5c6fd94fad7a7d8e5d61f/cursor
perl -i -pe 's/<YOUR_USERNAME>/`cmd.exe \/c echo %USERNAME% 2>\/dev\/null | tr -d "\r\n"`/ge' cursor_fix_template
perl -i -pe 's/ln -s "\$MY_CLI_DIR_YO\/cursor" "\$MY_CLI_DIR_YO\/code"/ln -sf "\$MY_CLI_DIR_YO\/cursor" "\$MY_CLI_DIR_YO\/code"/g' cursor_fix_template
mv cursor_fix_template $(which cursor)
chmod +x $(which cursor)
@BradKML
Copy link

BradKML commented Feb 13, 2025

Could you also check this one and see if it is a proper fix? https://gist.github.com/BradKML/b84675c356007c8029ce927c484f4cc6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment