Skip to content

Commit 61bb769

Browse files
feat: add support for Cursor tool in platform finder
- Updated README to include Cursor in the list of supported tools. - Implemented Cursor detection in Linux, MacOS, and Windows platform finders. - Added method to find Cursor executable in Windows.
1 parent aec5cab commit 61bb769

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ This app supports open repository in external tools listed in the table below.
152152
| Visual Studio Code | YES | YES | YES |
153153
| Visual Studio Code - Insiders | YES | YES | YES |
154154
| VSCodium | YES | YES | YES |
155+
| Cursor | YES | YES | YES |
155156
| Fleet | YES | YES | YES |
156157
| Sublime Text | YES | YES | YES |
157158
| Zed | NO | YES | YES |

src/Models/ExternalTool.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ public void Zed(Func<string> platformFinder)
154154
TryAdd("Zed", "zed", platformFinder);
155155
}
156156

157+
public void Cursor(Func<string> platformFinder)
158+
{
159+
TryAdd("Cursor", "cursor", platformFinder);
160+
}
161+
157162
public void FindJetBrainsFromToolbox(Func<string> platformFinder)
158163
{
159164
var exclude = new List<string> { "fleet", "dotmemory", "dottrace", "resharper-u", "androidstudio" };

src/Native/Linux.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public string FindTerminal(Models.ShellOrTerminal shell)
5252
finder.VSCode(() => FindExecutable("code"));
5353
finder.VSCodeInsiders(() => FindExecutable("code-insiders"));
5454
finder.VSCodium(() => FindExecutable("codium"));
55+
finder.Cursor(() => FindExecutable("cursor"));
5556
finder.Fleet(FindJetBrainsFleet);
5657
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/JetBrains/Toolbox");
5758
finder.SublimeText(() => FindExecutable("subl"));

src/Native/MacOS.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public string FindTerminal(Models.ShellOrTerminal shell)
7474
finder.VSCode(() => "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code");
7575
finder.VSCodeInsiders(() => "/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code");
7676
finder.VSCodium(() => "/Applications/VSCodium.app/Contents/Resources/app/bin/codium");
77+
finder.Cursor(() => "/Applications/Cursor.app/Contents/Resources/app/bin/cursor");
7778
finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Applications/Fleet.app/Contents/MacOS/Fleet");
7879
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Library/Application Support/JetBrains/Toolbox");
7980
finder.SublimeText(() => "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl");

src/Native/Windows.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public string FindTerminal(Models.ShellOrTerminal shell)
184184
finder.VSCode(FindVSCode);
185185
finder.VSCodeInsiders(FindVSCodeInsiders);
186186
finder.VSCodium(FindVSCodium);
187+
finder.Cursor(FindCursor);
187188
finder.Fleet(() => $@"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\Programs\Fleet\Fleet.exe");
188189
finder.FindJetBrainsFromToolbox(() => $@"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\JetBrains\Toolbox");
189190
finder.SublimeText(FindSublimeText);
@@ -387,6 +388,16 @@ private string FindVisualStudio()
387388

388389
return string.Empty;
389390
}
391+
392+
private string FindCursor()
393+
{
394+
var cursorPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Programs", "Cursor", "Cursor.exe");
395+
396+
if (File.Exists(cursorPath))
397+
return cursorPath;
398+
399+
return string.Empty;
400+
}
390401
#endregion
391402

392403
private void OpenFolderAndSelectFile(string folderPath)
1.86 KB
Loading

0 commit comments

Comments
 (0)