strip ansi escape codes

fixes #7644
This commit is contained in:
Joao Moreno 2016-06-15 13:00:40 +02:00
parent a610f9907f
commit 425305ae31
4 changed files with 15 additions and 3 deletions

9
npm-shrinkwrap.json generated
View file

@ -1,12 +1,17 @@
{
"name": "Code",
"version": "1.0.1",
"name": "code-oss-dev",
"version": "1.3.0",
"dependencies": {
"agent-base": {
"version": "1.0.2",
"from": "agent-base@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-1.0.2.tgz"
},
"ansi-regex": {
"version": "2.0.0",
"from": "ansi-regex@latest",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz"
},
"anymatch": {
"version": "1.3.0",
"from": "anymatch@>=1.1.0 <2.0.0",

View file

@ -14,6 +14,7 @@
"watch": "gulp watch"
},
"dependencies": {
"ansi-regex": "^2.0.0",
"applicationinsights": "0.15.6",
"chokidar": "1.0.5",
"emmet": "1.3.1",

5
src/typings/ansi-regex.d.ts vendored Normal file
View file

@ -0,0 +1,5 @@
declare module 'ansi-regex' {
function result(): RegExp;
module result {}
export = result;
}

View file

@ -31,6 +31,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { ILogService, MainLogService } from 'vs/code/electron-main/log';
import { IStorageService, StorageService } from 'vs/code/electron-main/storage';
import * as cp from 'child_process';
import * as ansiregex from 'ansi-regex';
function quit(accessor: ServicesAccessor, error?: Error);
function quit(accessor: ServicesAccessor, message?: string);
@ -311,7 +312,7 @@ function getUnixUserEnvironment(): TPromise<IEnv> {
const raw = Buffer.concat(buffers).toString('utf8');
try {
const env = JSON.parse(raw);
const env = JSON.parse(raw.replace(ansiregex(), ''));
if (runAsNode) {
env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = runAsNode;