4
4
#include "common/properties.h"
5
5
#include "detection/terminalshell/terminalshell.h"
6
6
#include "util/windows/unicode.h"
7
+ #include "util/windows/registry.h"
7
8
#include "util/stringUtils.h"
8
9
#include "terminalfont.h"
9
10
@@ -259,6 +260,22 @@ static void detectConEmu(FFTerminalFontResult* terminalFont)
259
260
ffFontInitValues (& terminalFont -> font , fontName .chars , fontSize .chars );
260
261
}
261
262
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
+
262
279
void ffDetectTerminalFontPlatform (const FFTerminalResult * terminal , FFTerminalFontResult * terminalFont )
263
280
{
264
281
if (ffStrbufIgnCaseEqualS (& terminal -> processName , "Windows Terminal" ) ||
@@ -270,4 +287,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalResult* terminal, FFTerminalFo
270
287
detectConhost (terminalFont );
271
288
else if (ffStrbufStartsWithIgnCaseS (& terminal -> processName , "ConEmu" ))
272
289
detectConEmu (terminalFont );
290
+ else if (ffStrbufStartsWithIgnCaseS (& terminal -> processName , "warp" ))
291
+ detectWarp (terminalFont );
273
292
}
0 commit comments