File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed
Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ static void initState(FFstate* state)
2525 state -> logoHeight = 0 ;
2626 state -> keysHeight = 0 ;
2727 state -> terminalLightTheme = false;
28+ state -> titleFqdn = false;
2829
2930 ffPlatformInit (& state -> platform );
3031 state -> configDoc = NULL ;
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ typedef struct FFstate
4949 uint32_t logoHeight ;
5050 uint32_t keysHeight ;
5151 bool terminalLightTheme ;
52+ bool titleFqdn ;
5253
5354 FFPlatform platform ;
5455 yyjson_doc * configDoc ;
Original file line number Diff line number Diff line change @@ -56,15 +56,14 @@ void ffPrintSeparator(FFSeparatorOptions* options)
5656 {
5757 setlocale (LC_CTYPE , "" );
5858 mbstate_t state = {};
59- bool fqdn = true; // TODO: Make this configurable
6059 const FFPlatform * platform = & instance .state .platform ;
6160
6261 FF_AUTO_FREE wchar_t * wstr = malloc ((max (
6362 platform -> userName .length , options -> string .length ) + 1 ) * sizeof (* wstr ));
6463
6564 uint32_t titleLength = 1 // @
6665 + getWcsWidth (& platform -> userName , wstr , & state ) // user name
67- + (fqdn ? platform -> hostName .length : ffStrbufFirstIndexC (& platform -> hostName , '.' )); // host name
66+ + (instance . state . titleFqdn ? platform -> hostName .length : ffStrbufFirstIndexC (& platform -> hostName , '.' )); // host name
6867
6968 if (__builtin_expect (options -> string .length == 1 , 1 ))
7069 {
Original file line number Diff line number Diff line change 22#include "common/jsonconfig.h"
33#include "modules/title/title.h"
44#include "util/textModifier.h"
5- #include "util/stringUtils.h"
65
76static void appendText (FFstrbuf * output , const FFstrbuf * text , const FFstrbuf * color )
87{
@@ -30,6 +29,7 @@ void ffPrintTitle(FFTitleOptions* options)
3029 FF_STRBUF_AUTO_DESTROY hostName = ffStrbufCreateCopy (& instance .state .platform .hostName );
3130 if (!options -> fqdn )
3231 ffStrbufSubstrBeforeFirstC (& hostName , '.' );
32+ instance .state .titleFqdn = options -> fqdn ;
3333
3434 FF_STRBUF_AUTO_DESTROY hostNameColored = ffStrbufCreate ();
3535 appendText (& hostNameColored , & hostName , & options -> colorHost );
You can’t perform that action at this time.
0 commit comments