Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ define(function (require, exports, module) {
Preferences.definePreference("shell", "string", "cmd.exe");
if (brackets.platform === "win") {
Preferences.set("shell", "cmd.exe");
} else if (brackets.platform === "mac") {
Preferences.set("shell", "/bin/bash");
} else {
Preferences.set("shell", "/bin/sh");
}
Expand Down
14 changes: 12 additions & 2 deletions node/hdyShellDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if false, return free memory only.
* @return {number} The amount of memory.
*/
function _execute(cmd, cwd, isWin, shell) {
function _execute(cmd, cwd, platform, shell) {

var spawn = require("child_process").spawn,
args,
Expand All @@ -36,6 +36,9 @@
catch (e) {}

}

var isWin = (platform === "win");
var isMac = (platform === "mac");

// clearing the console with clear or clr?
if ((cmd.toLowerCase() === "clear" && !isWin) ||
Expand All @@ -49,7 +52,14 @@
cmd = shell;
}
else {
args = ["-c", cmd];
if (!isMac) {
args = ["-c", cmd];
}
else {
var macEnvironment = "for i in $(defaults read $HOME/.MacOSX/environment | sed -nE 's/^(.+)= (.+\");/\\1/p' | sed -nE 's/^[ \\t]*//p'); do eval export $i=$(defaults read $HOME/.MacOSX/environment $i); done"
args = ["-c", macEnvironment + ";" + cmd];
}

cmd = shell;
}

Expand Down
2 changes: 1 addition & 1 deletion shellPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ define(function (require, exports, module) {
ShellDomain.exec("execute",
currentCommand.text(),
cwd,
brackets.platform === "win",
brackets.platform,
_preferences.get("shell"));

CommandRoll.push(currentCommand.text());
Expand Down