2020#include  "util/windows/version.h" 
2121#include  <windows.h> 
2222
23- static  bool  getFileVersion (const  FFstrbuf *  exePath , FFstrbuf *  version )
23+ static  bool  getFileVersion (const  FFstrbuf *  exePath , const   wchar_t *   stringName ,  FFstrbuf *  version )
2424{
2525    wchar_t  exePathW [PATH_MAX ];
2626    int  len  =  MultiByteToWideChar (CP_UTF8 , 0 , exePath -> chars , (int )exePath -> length , exePathW , ARRAY_SIZE (exePathW ));
2727    if  (len  <= 0 ) return  false;
28-     return  ffGetFileVersion (exePathW , version );
28+     return  ffGetFileVersion (exePathW , stringName ,  version );
2929}
30+ 
3031#elif  __HAIKU__ 
3132    #include  "util/haiku/version.h" 
3233#endif 
@@ -98,7 +99,7 @@ static bool getShellVersionPwsh(FFstrbuf* exe, FFstrbuf* version)
9899    }
99100
100101    #ifdef  _WIN32 
101-     if (getFileVersion (exe , version ))
102+     if (getFileVersion (exe , NULL ,  version ))
102103    {
103104        ffStrbufSubstrBeforeLastC (version , '.' );
104105        return  true;
@@ -291,7 +292,7 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* exePath,
291292    if (ffStrEqualsIgnCase (exeName , "powershell" ) ||  ffStrEqualsIgnCase (exeName , "powershell_ise" ))
292293        return  getShellVersionWinPowerShell (exe , version );
293294
294-     return  getFileVersion (exe , version );
295+     return  getFileVersion (exe , NULL ,  version );
295296    #endif 
296297
297298    return  false;
@@ -737,7 +738,7 @@ static bool getTerminalVersionWindowsTerminal(FFstrbuf* exe, FFstrbuf* version)
737738        return  true;
738739    }
739740
740-     return  getFileVersion (exe , version );
741+     return  getFileVersion (exe , NULL ,  version );
741742}
742743
743744static  bool  getTerminalVersionConEmu (FFstrbuf *  exe , FFstrbuf *  version )
@@ -747,7 +748,7 @@ static bool getTerminalVersionConEmu(FFstrbuf* exe, FFstrbuf* version)
747748    if (version -> length )
748749        return  true;
749750
750-     return  getFileVersion (exe , version );
751+     return  getFileVersion (exe , NULL ,  version );
751752}
752753
753754#endif 
@@ -839,6 +840,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
839840    if (ffStrbufStartsWithIgnCaseS (processName , "ConEmu" ))
840841        return  getTerminalVersionConEmu (exe , version );
841842
843+     if (ffStrbufIgnCaseEqualS (processName , "warp.exe" ))
844+         return  getFileVersion (exe , L"ProductVersion" , version );
845+ 
842846    #endif 
843847
844848    #ifndef  _WIN32 
@@ -914,7 +918,7 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
914918
915919    #ifdef  _WIN32 
916920
917-     return  getFileVersion (exe , version );
921+     return  getFileVersion (exe , NULL ,  version );
918922
919923    #else 
920924
0 commit comments