3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- var fs = require ( 'fs' ) ;
7
- var os = require ( 'os' ) ;
8
- var path = require ( 'path' ) ;
9
- var ptyJs = require ( 'node-pty' ) ;
6
+ import * as fs from 'fs' ;
7
+ fs . writeFileSync ( '/home/daniel/testing-terminal-1' , 'foo' ) ;
10
8
9
+ import * as os from 'os' ;
10
+ import * as path from 'path' ;
11
+ import * as ptyJs from 'node-pty' ;
12
+
13
+ fs . writeFileSync ( '/home/daniel/testing-terminal-2' , 'foo' ) ;
11
14
// The pty process needs to be run in its own child process to get around maxing out CPU on Mac,
12
15
// see https://github.com/electron/electron/issues/38
13
-
14
- var name ;
16
+ var shellName : string ;
15
17
if ( os . platform ( ) === 'win32' ) {
16
- name = path . basename ( process . env . PTYSHELL ) ;
18
+ shellName = path . basename ( process . env . PTYSHELL ) ;
17
19
} else {
18
20
// Using 'xterm-256color' here helps ensure that the majority of Linux distributions will use a
19
21
// color prompt as defined in the default ~/.bashrc file.
20
- name = 'xterm-256color' ;
22
+ shellName = 'xterm-256color' ;
21
23
}
22
24
var shell = process . env . PTYSHELL ;
23
25
var args = getArgs ( ) ;
@@ -29,16 +31,26 @@ var currentTitle = '';
29
31
setupPlanB ( process . env . PTYPID ) ;
30
32
cleanEnv ( ) ;
31
33
32
- var options = {
33
- name : name ,
34
- cwd : cwd
34
+ interface IOptions {
35
+ name : string ;
36
+ cwd : string ;
37
+ cols ?: number ;
38
+ rows ?: number ;
39
+ }
40
+
41
+ var options : IOptions = {
42
+ name : shellName ,
43
+ cwd
35
44
} ;
36
45
if ( cols && rows ) {
37
46
options . cols = parseInt ( cols , 10 ) ;
38
47
options . rows = parseInt ( rows , 10 ) ;
39
48
}
40
49
50
+ fs . writeFileSync ( '/home/daniel/testing-terminal-3' , 'foo' ) ;
41
51
var ptyProcess = ptyJs . fork ( shell , args , options ) ;
52
+
53
+ fs . writeFileSync ( '/home/daniel/testing-terminal-4' , 'foo' ) ;
42
54
var closeTimeout ;
43
55
var exitCode ;
44
56
@@ -93,6 +105,7 @@ function getArgs() {
93
105
94
106
function cleanEnv ( ) {
95
107
var keys = [
108
+ 'AMD_ENTRYPOINT' ,
96
109
'ELECTRON_RUN_AS_NODE' ,
97
110
'PTYCWD' ,
98
111
'PTYPID' ,
0 commit comments