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)
25
25
state -> logoHeight = 0 ;
26
26
state -> keysHeight = 0 ;
27
27
state -> terminalLightTheme = false;
28
+ state -> titleFqdn = false;
28
29
29
30
ffPlatformInit (& state -> platform );
30
31
state -> configDoc = NULL ;
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ typedef struct FFstate
49
49
uint32_t logoHeight ;
50
50
uint32_t keysHeight ;
51
51
bool terminalLightTheme ;
52
+ bool titleFqdn ;
52
53
53
54
FFPlatform platform ;
54
55
yyjson_doc * configDoc ;
Original file line number Diff line number Diff line change @@ -56,15 +56,14 @@ void ffPrintSeparator(FFSeparatorOptions* options)
56
56
{
57
57
setlocale (LC_CTYPE , "" );
58
58
mbstate_t state = {};
59
- bool fqdn = true; // TODO: Make this configurable
60
59
const FFPlatform * platform = & instance .state .platform ;
61
60
62
61
FF_AUTO_FREE wchar_t * wstr = malloc ((max (
63
62
platform -> userName .length , options -> string .length ) + 1 ) * sizeof (* wstr ));
64
63
65
64
uint32_t titleLength = 1 // @
66
65
+ 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
68
67
69
68
if (__builtin_expect (options -> string .length == 1 , 1 ))
70
69
{
Original file line number Diff line number Diff line change 2
2
#include "common/jsonconfig.h"
3
3
#include "modules/title/title.h"
4
4
#include "util/textModifier.h"
5
- #include "util/stringUtils.h"
6
5
7
6
static void appendText (FFstrbuf * output , const FFstrbuf * text , const FFstrbuf * color )
8
7
{
@@ -30,6 +29,7 @@ void ffPrintTitle(FFTitleOptions* options)
30
29
FF_STRBUF_AUTO_DESTROY hostName = ffStrbufCreateCopy (& instance .state .platform .hostName );
31
30
if (!options -> fqdn )
32
31
ffStrbufSubstrBeforeFirstC (& hostName , '.' );
32
+ instance .state .titleFqdn = options -> fqdn ;
33
33
34
34
FF_STRBUF_AUTO_DESTROY hostNameColored = ffStrbufCreate ();
35
35
appendText (& hostNameColored , & hostName , & options -> colorHost );
You can’t perform that action at this time.
0 commit comments