Tried to use TProcess on ArchLinux but it hangs for dir command or ls or df , it waits for the user to press Enter/Return . Other commands like ncdu or nnn or ranger fail to launch.
Program tprc;
uses sysutils, process;
var aProc : TProcess;
begin
aProc := TProcess.Create(nil);
aProc.Executable := 'dir';
aProc.Execute;
aProc.Free;
end.
Used FPC version 3.2.2
I'm new to TProcess so maybe I'm doing something wrong.
I would also be interested how to launch builtin bash functions like history, or aliases or escaping aliases.
Also tried in windows 7 VM the dir command but did not work.
Launching graphical programs worked, like mate-calc in Linux or notepad / calc in windows.
Also worth noting is that when piping the output of dir into cat or cut it worked and did not expect a new line from the user:
./tprc | cat
./tprc | cut -f 1 -d '.'
Any constructive answer is much appreciated.