Skip to content

Instantly share code, notes, and snippets.

@surajsharma
Created August 15, 2025 05:43
Show Gist options
  • Save surajsharma/d9b651726487da8f408a993752bd2d2b to your computer and use it in GitHub Desktop.
Save surajsharma/d9b651726487da8f408a993752bd2d2b to your computer and use it in GitHub Desktop.
subl in linux
#!/bin/bash
# Convert WSL path to Windows path
if [ "$1" = "." ]; then
WINPATH=$(wslpath -w $(pwd))
elif [ -n "$1" ]; then
WINPATH=$(wslpath -w "$1")
else
WINPATH=""
fi
# Launch Sublime Text with Windows path, suppress stderr
/mnt/c/Users/suraj/Downloads/sublime_text_build_4200_x64/sublime_text.exe "$WINPATH" 2>/dev/null &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment