<commit_before>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

var fs = require('fs');
var ptyJs = require('pty.js');

// The pty process needs to be run in its own child process to get around maxing out CPU on Mac,
// see https://github.com/electron/electron/issues/38

var ptyProcess = ptyJs.fork(process.env.PTYSHELL, getArgs(), {
	name: fs.existsSync('/usr/share/terminfo/x/xterm-256color') ? 'xterm-256color' : 'xterm',
	cwd: process.env.PTYCWD
});
var currentTitle = '';

ptyProcess.on('data', function (data) {
	process.send({
		type: 'data',
		content: data
	});
});

ptyProcess.on('exit', function (exitCode) {
	process.exit(exitCode);
});<commit_msg>Set name of term on Windows to shell file name<commit_after>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

var fs = require('fs');
var os = require('os');
var path = require('path');
var ptyJs = require('pty.js');

// The pty process needs to be run in its own child process to get around maxing out CPU on Mac,
// see https://github.com/electron/electron/issues/38

var name;
if (os.platform() === 'win32') {
	name = path.basename(process.env.PTYSHELL);
} else {
	name = fs.existsSync('/usr/share/terminfo/x/xterm-256color') ? 'xterm-256color' : 'xterm';
}

var ptyProcess = ptyJs.fork(process.env.PTYSHELL, getArgs(), {
	name: name,
	cwd: process.env.PTYCWD
});
var currentTitle = '';

ptyProcess.on('data', function (data) {
	process.send({
		type: 'data',
		content: data
	});
});

ptyProcess.on('exit', function (exitCode) {
	process.exit(exitCode);
});
{'fraction_non_alphanumeric': 0.3034288398309065, 'fraction_numerical': 0.008454673555659934, 'mean_word_length': 2.0169971671388103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4555893', 'n_tokens_mistral': 616, 'n_tokens_neox': 599, 'n_words': 173}