mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: issues about Terminal (#756)
This commit is contained in:
parent
e4ca93fee2
commit
1fbdc9cb16
2 changed files with 24 additions and 7 deletions
|
|
@ -44,6 +44,8 @@ function StringToCFStringRef(const S: String): CFStringRef;
|
|||
function NSArrayToList(const theArray:NSArray): TStringList;
|
||||
function ListToNSArray(const list:TStrings): NSArray;
|
||||
|
||||
function getMacOSDefaultTerminal(): String;
|
||||
|
||||
procedure cocoaInvalidControlCursor( const control:TWinControl );
|
||||
|
||||
function NSGetTempPath: String;
|
||||
|
|
@ -296,6 +298,11 @@ begin
|
|||
Result:= IncludeTrailingBackslash(NSTemporaryDirectory.UTF8String);
|
||||
end;
|
||||
|
||||
function getMacOSDefaultTerminal(): String;
|
||||
begin
|
||||
Result:= NSStringToString( NSWorkspace.sharedWorkspace.fullPathForApplication( NSStr('terminal') ) );
|
||||
end;
|
||||
|
||||
function StringToNSString(const S: String): NSString;
|
||||
begin
|
||||
Result:= NSString(NSString.stringWithUTF8String(PAnsiChar(S)));
|
||||
|
|
|
|||
|
|
@ -761,6 +761,9 @@ uses
|
|||
{$IF DEFINED(MSWINDOWS)}
|
||||
, ShlObj
|
||||
{$ENDIF}
|
||||
{$IF DEFINED(DARWIN)}
|
||||
, uMyDarwin
|
||||
{$ENDIF}
|
||||
{$if lcl_fullversion >= 2010000}
|
||||
, SynEditMiscClasses
|
||||
{$endif}
|
||||
|
|
@ -2623,14 +2626,21 @@ begin
|
|||
|
||||
// Let's try to be backward comptible and re-load possible old values for terminal launch command
|
||||
gRunTermCmd := GetValue(Node, 'JustRunTerminal', '');
|
||||
if gRunTermCmd = '' then
|
||||
begin
|
||||
gRunTermCmd := GetValue(Node, 'RunTerminal', RunTermCmd);
|
||||
SplitCmdLineToCmdParams(gRunTermCmd, gRunTermCmd,gRunTermParams);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if gRunTermCmd <> '' then begin
|
||||
gRunTermParams := GetValue(Node, 'JustRunTermParams', RunTermParams);
|
||||
end else begin
|
||||
gRunTermCmd := GetValue(Node, 'RunTerminal', '' );
|
||||
if gRunTermCmd <> '' then begin
|
||||
SplitCmdLineToCmdParams(gRunTermCmd, gRunTermCmd, gRunTermParams);
|
||||
end else begin
|
||||
{$IF DEFINED(DARWIN)}
|
||||
gRunTermCmd:= getMacOSDefaultTerminal;
|
||||
if gRunTermCmd = '' then gRunTermCmd := RunTermCmd;
|
||||
{$ELSE}
|
||||
gRunTermCmd := RunTermCmd;
|
||||
{$ENDIF}
|
||||
gRunTermParams := RunTermParams;
|
||||
end;
|
||||
end;
|
||||
|
||||
gOnlyOneAppInstance := GetValue(Node, 'OnlyOneAppInstance', gOnlyOneAppInstance);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue