I think you have to remove the "not" in line 47?
Maybe you overlooked that one ...?
I just did a little test and this works correctly;
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, process;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
s:ansistring;
begin
if RunCommand('/bin/ps',['-eo','pmem,rss,pid,command'], s) then
Memo1.Text:=s;
end;
end.
RunCommand returns True if the function executed successfully.
I'm running MacOS Mojave 10.14.5, and Lazarus 2.1.0 r61306M FPC 3.0.4 x86_64-darwin-cocoa (alpha) (from trunk).