mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
@@ -23,6 +23,7 @@ typedef struct FFTerminalResult
|
||||
const char* exeName; //pointer to a char in exe
|
||||
FFstrbuf exePath; //Full real path to executable file
|
||||
FFstrbuf version;
|
||||
FFstrbuf tty;
|
||||
uint32_t pid;
|
||||
uint32_t ppid;
|
||||
} FFTerminalResult;
|
||||
|
||||
@@ -571,6 +571,7 @@ const FFTerminalResult* ffDetectTerminal()
|
||||
result.exeName = result.exe.chars;
|
||||
ffStrbufInit(&result.exePath);
|
||||
ffStrbufInit(&result.version);
|
||||
ffStrbufInitS(&result.tty, ttyname(STDOUT_FILENO));
|
||||
result.pid = 0;
|
||||
result.ppid = 0;
|
||||
|
||||
|
||||
@@ -369,6 +369,7 @@ const FFShellResult* ffDetectShell(void)
|
||||
ffStrbufInit(&result.exePath);
|
||||
ffStrbufInit(&result.prettyName);
|
||||
ffStrbufInit(&result.version);
|
||||
ffStrbufInit(&result.tty);
|
||||
result.pid = 0;
|
||||
result.ppid = 0;
|
||||
result.tty = -1;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define FF_TERMINAL_NUM_FORMAT_ARGS 7
|
||||
#define FF_TERMINAL_NUM_FORMAT_ARGS 8
|
||||
|
||||
void ffPrintTerminal(FFTerminalOptions* options)
|
||||
{
|
||||
@@ -37,6 +37,7 @@ void ffPrintTerminal(FFTerminalOptions* options)
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->prettyName},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->version},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->exePath},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result->tty},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -95,6 +96,7 @@ void ffGenerateTerminalJsonResult(FF_MAYBE_UNUSED FFTerminalOptions* options, yy
|
||||
yyjson_mut_obj_add_uint(doc, obj, "ppid", result->ppid);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "prettyName", &result->prettyName);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "version", &result->version);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "tty", &result->tty);
|
||||
}
|
||||
|
||||
void ffPrintTerminalHelpFormat(void)
|
||||
@@ -107,6 +109,7 @@ void ffPrintTerminalHelpFormat(void)
|
||||
"Terminal pretty name",
|
||||
"Terminal version",
|
||||
"Terminal full exe path",
|
||||
"Terminal tty / pts used",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user