TerminalShell: add support for Windows

This commit is contained in:
李通洲
2022-10-08 16:04:55 +08:00
parent 8246c6e61d
commit 09a2f96cf0
15 changed files with 249 additions and 27 deletions
-1
View File
@@ -2,7 +2,6 @@
#include "common/properties.h"
#include "common/printing.h"
#include "common/caching.h"
#include "common/processing.h"
#include "common/parsing.h"
#include <stdlib.h>
+2 -2
View File
@@ -1,6 +1,6 @@
#include "fastfetch.h"
#include "common/printing.h"
#include "detection/terminalshell.h"
#include "detection/terminalshell/terminalshell.h"
#define FF_SHELL_MODULE_NAME "Shell"
#define FF_SHELL_NUM_FORMAT_ARGS 7
@@ -18,7 +18,7 @@ void ffPrintShell(FFinstance* instance)
if(instance->config.shell.outputFormat.length == 0)
{
ffPrintLogoAndKey(instance, FF_SHELL_MODULE_NAME, 0, &instance->config.shell.key);
fputs(result->shellExeName, stdout);
ffStrbufWriteTo(&result->shellProcessName, stdout);
if(result->shellVersion.length > 0)
{
+2 -6
View File
@@ -1,6 +1,6 @@
#include "fastfetch.h"
#include "common/printing.h"
#include "detection/terminalshell.h"
#include "detection/terminalshell/terminalshell.h"
#include <string.h>
@@ -20,11 +20,7 @@ void ffPrintTerminal(FFinstance* instance)
if(instance->config.terminal.outputFormat.length == 0)
{
ffPrintLogoAndKey(instance, FF_TERMINAL_MODULE_NAME, 0, &instance->config.terminal.key);
if(strncmp(result->terminalExeName, result->terminalProcessName.chars, result->terminalProcessName.length) == 0) // if exeName starts with processName, print it. Otherwise print processName
puts(result->terminalExeName);
else
ffStrbufPutTo(&result->terminalProcessName, stdout);
ffStrbufPutTo(&result->terminalProcessName, stdout);
}
else
{