Skip to content

Commit

Permalink
Merge branch 'warpdesign-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhidey committed Dec 16, 2014
2 parents 030c059 + eca03c7 commit 447c16e
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 245 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
## Change Log

### v0.0.9
* BUGFIX: Replace character with charCode 65533 to avoid showing garbage on command result on Windows (10?)
* DOC: updated readme file with extension options and usage
* BUGFIX: Finally have *nix platforms environment pulling it. I have verified this on a Ubuntu 14 x64 installation. Currently
only support the sh (Bourne) shell.

### v0.0.8
* BUGFIX: Prompt will not focus when you click anywhere within the shell panel
* BUGFIX: Prompt disables immediately after pressing enter to prevent the accidently
Expand Down
7 changes: 0 additions & 7 deletions Gruntfile.js
Expand Up @@ -24,13 +24,6 @@ module.exports = function(grunt) {
copy: {
main: {
files: [
{
expand: true,
cwd: "node_modules/splitargs/",
src: ["**/*"],
dest: "node/node_modules/splitargs/",
filter: "isFile"
},
{
expand: true,
cwd: "node_modules/tree-kill/",
Expand Down
11 changes: 10 additions & 1 deletion README.md
@@ -1,10 +1,19 @@
hdy.Brackets-Shell--
hdy.Brackets-Shell
==================
A brackets extension giving you access to the system shell within brackets.

##Screenshots
![][screenshot]

##Usage
Brackets-Shell adds a new icon on the right panel: click on it to toggle the shell's panel

##Options
Brackets-Shell adds the following options to your brackets.json file:

* `hdy.brackets-shell.dark`: set to true if you are using Bracket's dark theme (defaults to false)
* `hdy.brackets-shell.trackProject`: set to true if you want to have the Bracket's shell automatically be set to your project's root directory

##Change Log
Please see [`CHANGELOG.md`](CHANGELOG.md)

Expand Down
14 changes: 4 additions & 10 deletions node/hdyShellDomain.js
Expand Up @@ -17,7 +17,6 @@
function _execute(cmd, cwd, isWin) {

var spawn = require("child_process").spawn,
splitarps = require("splitargs"),
args,
enddir = cwd,
tempdir;
Expand Down Expand Up @@ -45,18 +44,13 @@
_domainManager.emitEvent("hdyShellDomain", "clear");
}

args = splitarps(cmd);
if (args.length === 0) {
args = [];
}

if (isWin) {
args = ["/c", cmd];
cmd = "cmd.exe";
args.unshift("/c");
}
else {
cmd = "sh";
args.unshift("-c");
args = ["-c", cmd];
cmd = "/bin/sh";
}

child = spawn(cmd, args, { cwd: cwd, env: process.env });
Expand Down Expand Up @@ -99,7 +93,7 @@
function _init(domainManager) {

if (!domainManager.hasDomain("hdyShellDomain")) {
domainManager.registerDomain("hdyShellDomain", {major: 0, minor: 1});
domainManager.registerDomain("hdyShellDomain", {major: 0, minor: 2});
}

domainManager.registerCommand(
Expand Down
63 changes: 0 additions & 63 deletions node/node_modules/splitargs/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions node/node_modules/splitargs/package.json

This file was deleted.

68 changes: 0 additions & 68 deletions node/node_modules/splitargs/splitArgsSpec.js

This file was deleted.

59 changes: 0 additions & 59 deletions node/node_modules/splitargs/splitargs.js

This file was deleted.

10 changes: 7 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "hdy.brackets-shell",
"title": "Brackets Shell",
"version": "0.0.8",
"version": "0.0.9",
"description": "Shell access within Brackets",
"homepage": "http://john.hidey.com/hdy.brackets-shell/",
"repository": {
Expand All @@ -14,8 +14,12 @@
},
"license": "MIT",
"keywords": [
"command",
"shell"
"Command",
"Prompt",
"Shell",
"OS-X",
"Linux",
"Windows"
],
"engines": {
"brackets": ">=0.40.0"
Expand Down
15 changes: 14 additions & 1 deletion shellPanel.js
Expand Up @@ -157,6 +157,14 @@ define(function (require, exports, module) {

}

function replaceCharAtIndex(str, index, newChar) {
var array = str.split('');

array[index] = newChar;

return array.join('');
}

function _addShellOutput(data) {

var currentCommandGroup = $(".hdy-current"),
Expand All @@ -174,12 +182,17 @@ define(function (require, exports, module) {
if(ansiFormat.hasAceptedAnsiFormat(data)){
ansiFormat.formattedText(data, currentCommandResult);
} else {
for (var i = 0; i < data.length; i++) {
if (data.charCodeAt(i) === 65533) {
data = replaceCharAtIndex(data, i, ".");
}
}
$("pre", currentCommandResult).append(document.createTextNode(data));
}

_scrollToBottom();
}

function _addShellLine(cwd) {

var commandGroups = $(".hdy-command-groups"),
Expand Down

0 comments on commit 447c16e

Please sign in to comment.