瀏覽代碼

ADD: Execute command in terminal (OS X)

Alexander Koblov 9 年之前
父節點
當前提交
bdb02153d1
共有 3 個文件被更改,包括 15 次插入6 次删除
  1. 4 0
      install/darwin/install.sh
  2. 5 2
      install/linux/install.sh
  3. 6 4
      src/platform/uOSUtils.pas

+ 4 - 0
install/darwin/install.sh

@@ -57,6 +57,10 @@ mkdir -p $DC_INSTALL_DIR/doc
 cp -r doc/en    $DC_INSTALL_DIR/doc/
 cp -a doc/*.txt $DC_INSTALL_DIR/doc/
 
+# Copy scripts
+mkdir -p $DC_INSTALL_DIR/scripts
+cp -a scripts/terminal.sh $DC_INSTALL_DIR/scripts/
+
 # Copy directories
 cp -r language $DC_INSTALL_DIR/
 cp -r pixmaps  $DC_INSTALL_DIR/

+ 5 - 2
install/linux/install.sh

@@ -111,7 +111,8 @@ if [ -z $CK_PORTABLE ]
     install -m 644 doc/*.txt  $DC_INSTALL_PREFIX/usr/share/doublecmd/doc
     ln -sf ../../share/doublecmd/doc $DC_INSTALL_DIR/doc
     # Copy scripts
-    cp -r scripts $DC_INSTALL_DIR/
+    install -d         $DC_INSTALL_DIR/scripts
+    cp -a scripts/*.py $DC_INSTALL_DIR/scripts/
     # Copy languages
     cp -r language $DC_INSTALL_PREFIX/usr/share/doublecmd
     ln -sf ../../share/doublecmd/language $DC_INSTALL_DIR/language
@@ -135,7 +136,9 @@ if [ -z $CK_PORTABLE ]
     # Copy directories
     cp -r language $DC_INSTALL_DIR/
     cp -r pixmaps  $DC_INSTALL_DIR/
-    cp -r scripts  $DC_INSTALL_DIR/
+    # Copy scripts
+    install -d         $DC_INSTALL_DIR/scripts
+    cp -a scripts/*.py $DC_INSTALL_DIR/scripts/
     # Copy libraries
     install -m 644 *.so*    $DC_INSTALL_DIR/
     # Copy DC icon

+ 6 - 4
src/platform/uOSUtils.pas

@@ -57,8 +57,8 @@ const
   RunTermCmd = '/Applications/Utilities/Terminal.app %D';  // default terminal
   RunTermParams = '';
   RunInTerm = ''; // default run in terminal command
-  RunInTermStayOpenCmd = ''; // default run in terminal command AND Stay open after command
-  RunInTermStayOpenParams = '';
+  RunInTermStayOpenCmd = '%COMMANDER_PATH%/scripts/terminal.sh'; // default run in terminal command AND Stay open after command
+  RunInTermStayOpenParams = '{command}';
   RunInTermCloseCmd = ''; // default run in terminal command AND Close after command
   RunInTermCloseParams = '';
   MonoSpaceFont = 'Monaco';
@@ -748,10 +748,12 @@ begin
     sConfigParam := gRunInTermCloseParams;
   end;
 
-  if pos(CnstUserCommand,sConfigParam)<>0 then
+  sCmd := ReplaceEnvVars(sCmd);
+
+  if Pos(CnstUserCommand, sConfigParam) <> 0 then
     sParams := StringReplace(sConfigParam, CnstUserCommand, sParams , [rfIgnoreCase])
   else
-    sParams:=ConcatenateStrWithSpace(sConfigParam, sParams);
+    sParams := ConcatenateStrWithSpace(sConfigParam, sParams);
 
 {$ELSEIF DEFINED(MSWINDOWS)}
 //  if bKeepTerminalOpen then