mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-05 13:25:58 +02:00
+ use "Terminal" under Haiku to launch external programs (patch by
Olivier Coursiere, mantis #17392) git-svn-id: trunk@16107 -
This commit is contained in:
parent
92997a0249
commit
ea706f6271
@ -136,6 +136,15 @@ end;
|
|||||||
|
|
||||||
Function MakeCommand(P : TProcess) : PPchar;
|
Function MakeCommand(P : TProcess) : PPchar;
|
||||||
|
|
||||||
|
{$ifdef darwin}
|
||||||
|
Const
|
||||||
|
TerminalApp = 'open';
|
||||||
|
{$endif}
|
||||||
|
{$ifdef haiku}
|
||||||
|
Const
|
||||||
|
TerminalApp = 'Terminal';
|
||||||
|
{$endif}
|
||||||
|
|
||||||
Var
|
Var
|
||||||
Cmd : String;
|
Cmd : String;
|
||||||
S : TStringList;
|
S : TStringList;
|
||||||
@ -160,8 +169,15 @@ begin
|
|||||||
CommandToList(Cmd,S);
|
CommandToList(Cmd,S);
|
||||||
if poNewConsole in P.Options then
|
if poNewConsole in P.Options then
|
||||||
begin
|
begin
|
||||||
{$ifdef darwin}
|
{$ifdef haiku}
|
||||||
S.Insert(0,'open');
|
If (P.ApplicationName<>'') then
|
||||||
|
begin
|
||||||
|
S.Insert(0,P.ApplicationName);
|
||||||
|
S.Insert(0,'--title');
|
||||||
|
end;
|
||||||
|
{$endif}
|
||||||
|
{$if defined(darwin) or defined(haiku)}
|
||||||
|
S.Insert(0,TerminalApp);
|
||||||
{$else}
|
{$else}
|
||||||
S.Insert(0,'-e');
|
S.Insert(0,'-e');
|
||||||
If (P.ApplicationName<>'') then
|
If (P.ApplicationName<>'') then
|
||||||
@ -177,6 +193,7 @@ begin
|
|||||||
S.Insert(0,'xterm');
|
S.Insert(0,'xterm');
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
{$ifndef haiku}
|
||||||
if (P.ApplicationName<>'') then
|
if (P.ApplicationName<>'') then
|
||||||
begin
|
begin
|
||||||
S.Add(TitleOption);
|
S.Add(TitleOption);
|
||||||
@ -192,6 +209,7 @@ begin
|
|||||||
S.Add(GeometryOption);
|
S.Add(GeometryOption);
|
||||||
S.Add(g);
|
S.Add(g);
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
Result:=StringsToPcharList(S);
|
Result:=StringsToPcharList(S);
|
||||||
Finally
|
Finally
|
||||||
S.free;
|
S.free;
|
||||||
@ -293,7 +311,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$if (defined(DARWIN) or defined(SUNOS))}
|
{$if (defined(DARWIN) or defined(SUNOS))}
|
||||||
Pid:=fpvfork;
|
{ can't use vfork in case the child has to be
|
||||||
|
suspended immediately, because with vfork the
|
||||||
|
child borrows the execution thread of the parent
|
||||||
|
unit it either exits or execs -> potential
|
||||||
|
deadlock depending on how quickly the SIGSTOP
|
||||||
|
signal is delivered }
|
||||||
|
if not(poRunSuspended in Options) then
|
||||||
|
Pid:=fpvfork
|
||||||
|
else
|
||||||
|
Pid:=fpfork;
|
||||||
{$else}
|
{$else}
|
||||||
Pid:=fpfork;
|
Pid:=fpfork;
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -405,7 +432,11 @@ begin
|
|||||||
If Running then
|
If Running then
|
||||||
Result:=fpkill(Handle,SIGKILL)=0;
|
Result:=fpkill(Handle,SIGKILL)=0;
|
||||||
end;
|
end;
|
||||||
GetExitStatus;
|
{ the fact that the signal has been sent does not
|
||||||
|
mean that the process has already handled the
|
||||||
|
signal -> wait instead of calling getexitstatus }
|
||||||
|
if Result then
|
||||||
|
WaitOnExit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TProcess.SetShowWindow (Value : TShowWindowOptions);
|
Procedure TProcess.SetShowWindow (Value : TShowWindowOptions);
|
||||||
|
Loading…
Reference in New Issue
Block a user