From 72ba20fa5f077bab4286dd78f9944df15de3b3b4 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 31 Aug 2021 15:38:52 +1000 Subject: Introduce screen tabs This is a forward port (by nathans) of Hisham's original code. --- darwin/DarwinProcess.c | 2 +- darwin/Platform.c | 10 ++++++++++ darwin/Platform.h | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'darwin') diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c index 95ae960f..231ca143 100644 --- a/darwin/DarwinProcess.c +++ b/darwin/DarwinProcess.c @@ -322,7 +322,7 @@ void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, DarwinProcess_updateExe(ep->p_pid, proc); DarwinProcess_updateCmdLine(ps, proc); - if (proc->settings->flags & PROCESS_FLAG_CWD) { + if (proc->settings->ss->flags & PROCESS_FLAG_CWD) { DarwinProcess_updateCwd(ep->p_pid, proc); } } diff --git a/darwin/Platform.c b/darwin/Platform.c index 152f617b..7fda8309 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -49,6 +49,16 @@ in the source distribution for its full text. #endif +ScreenDefaults Platform_defaultScreens[] = { + { + .name = "Main", + .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME COMM", + .sortKey = "PERCENT_CPU", + }, +}; + +const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); + const ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_VIRT, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; const SignalItem Platform_signals[] = { diff --git a/darwin/Platform.h b/darwin/Platform.h index fe75db06..0022478f 100644 --- a/darwin/Platform.h +++ b/darwin/Platform.h @@ -26,7 +26,9 @@ in the source distribution for its full text. #include "generic/uname.h" -extern const ProcessField Platform_defaultFields[]; +extern ScreenDefaults Platform_defaultScreens[]; + +extern const unsigned int Platform_numberOfDefaultScreens; extern const SignalItem Platform_signals[]; -- cgit v1.2.3