@@ -187,10 +187,11 @@ public string FindTerminal(Models.ShellOrTerminal shell)
187187 finder . VSCode ( FindVSCode ) ;
188188 finder . VSCodeInsiders ( FindVSCodeInsiders ) ;
189189 finder . VSCodium ( FindVSCodium ) ;
190- finder . Cursor ( FindCursor ) ;
190+ finder . Cursor ( ( ) => Path . Combine ( localAppDataDir , @"Programs\Cursor\Cursor.exe" ) ) ;
191191 finder . Fleet ( ( ) => Path . Combine ( localAppDataDir , @"Programs\Fleet\Fleet.exe" ) ) ;
192192 finder . FindJetBrainsFromToolbox ( ( ) => Path . Combine ( localAppDataDir , @"JetBrains\Toolbox" ) ) ;
193193 finder . SublimeText ( FindSublimeText ) ;
194+ finder . Zed ( ( ) => FindZed ( localAppDataDir ) ) ;
194195 FindVisualStudio ( finder ) ;
195196 return finder . Tools ;
196197 }
@@ -415,16 +416,20 @@ private void FindVisualStudio(Models.ExternalToolsFinder finder)
415416 }
416417 }
417418
418- private string FindCursor ( )
419+ private string FindZed ( string localAppDataDir )
419420 {
420- var cursorPath = Path . Combine (
421- Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) ,
422- "Programs" ,
423- "Cursor" ,
424- "Cursor.exe" ) ;
425-
426- if ( File . Exists ( cursorPath ) )
427- return cursorPath ;
421+ var currentUser = Microsoft . Win32 . RegistryKey . OpenBaseKey (
422+ Microsoft . Win32 . RegistryHive . CurrentUser ,
423+ Microsoft . Win32 . RegistryView . Registry64 ) ;
424+
425+ // NOTE: this is the official Zed Preview reg data.
426+ var preview = currentUser . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F70E4811-D0E2-4D88-AC99-D63752799F95}_is1" ) ;
427+ if ( preview != null )
428+ return preview . GetValue ( "DisplayIcon" ) as string ;
429+
430+ var findInPath = new StringBuilder ( "zed.exe" , 512 ) ;
431+ if ( PathFindOnPath ( findInPath , null ) )
432+ return findInPath . ToString ( ) ;
428433
429434 return string . Empty ;
430435 }
0 commit comments