44#include "common/properties.h"
55#include "detection/terminalshell/terminalshell.h"
66#include "util/windows/unicode.h"
7+ #include "util/windows/registry.h"
78#include "util/stringUtils.h"
89#include "terminalfont.h"
910
@@ -259,6 +260,22 @@ static void detectConEmu(FFTerminalFontResult* terminalFont)
259260 ffFontInitValues (& terminalFont -> font , fontName .chars , fontSize .chars );
260261}
261262
263+ static void detectWarp (FFTerminalFontResult * terminalFont )
264+ {
265+ FF_HKEY_AUTO_DESTROY key = NULL ;
266+ if (!ffRegOpenKeyForRead (HKEY_CURRENT_USER , L"Software\\Warp.dev\\Warp" , & key , & terminalFont -> error ))
267+ return ;
268+
269+ FF_STRBUF_AUTO_DESTROY fontName = ffStrbufCreate ();
270+ FF_STRBUF_AUTO_DESTROY fontSize = ffStrbufCreate ();
271+ if (!ffRegReadStrbuf (key , L"FontName" , & fontName , NULL ))
272+ ffStrbufSetS (& fontName , "Hack" );
273+ if (!ffRegReadStrbuf (key , L"FontSize" , & fontSize , & terminalFont -> error ))
274+ ffStrbufSetS (& fontSize , "13" );
275+
276+ ffFontInitValues (& terminalFont -> font , fontName .chars , fontSize .chars );
277+ }
278+
262279void ffDetectTerminalFontPlatform (const FFTerminalResult * terminal , FFTerminalFontResult * terminalFont )
263280{
264281 if (ffStrbufIgnCaseEqualS (& terminal -> processName , "Windows Terminal" ) ||
@@ -270,4 +287,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo
270287 detectConhost (terminalFont );
271288 else if (ffStrbufStartsWithIgnCaseS (& terminal -> processName , "ConEmu" ))
272289 detectConEmu (terminalFont );
290+ else if (ffStrbufStartsWithIgnCaseS (& terminal -> processName , "warp" ))
291+ detectWarp (terminalFont );
273292}
0 commit comments