1 | ;
|
2 | /**
|
3 | * Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
|
4 | * Copyright (c) 2016, Daniel Imms (MIT License).
|
5 | * Copyright (c) 2018, Microsoft Corporation (MIT License).
|
6 | */
|
7 | Object.defineProperty(exports, "__esModule", { value: true });
|
8 | var terminalCtor;
|
9 | if (process.platform === 'win32') {
|
10 | terminalCtor = require('./windowsTerminal').WindowsTerminal;
|
11 | }
|
12 | else {
|
13 | terminalCtor = require('./unixTerminal').UnixTerminal;
|
14 | }
|
15 | /**
|
16 | * Forks a process as a pseudoterminal.
|
17 | * @param file The file to launch.
|
18 | * @param args The file's arguments as argv (string[]) or in a pre-escaped
|
19 | * CommandLine format (string). Note that the CommandLine option is only
|
20 | * available on Windows and is expected to be escaped properly.
|
21 | * @param options The options of the terminal.
|
22 | * @throws When the file passed to spawn with does not exists.
|
23 | * @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
|
24 | * @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
|
25 | * @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
|
26 | */
|
27 | function spawn(file, args, opt) {
|
28 | return new terminalCtor(file, args, opt);
|
29 | }
|
30 | exports.spawn = spawn;
|
31 | /** @deprecated */
|
32 | function fork(file, args, opt) {
|
33 | return new terminalCtor(file, args, opt);
|
34 | }
|
35 | exports.fork = fork;
|
36 | /** @deprecated */
|
37 | function createTerminal(file, args, opt) {
|
38 | return new terminalCtor(file, args, opt);
|
39 | }
|
40 | exports.createTerminal = createTerminal;
|
41 | function open(options) {
|
42 | return terminalCtor.open(options);
|
43 | }
|
44 | exports.open = open;
|
45 | /**
|
46 | * Expose the native API when not Windows, note that this is not public API and
|
47 | * could be removed at any time.
|
48 | */
|
49 | exports.native = (process.platform !== 'win32' ? require('../build/Release/pty.node') : null);
|
50 | //# sourceMappingURL=index.js.map |
\ | No newline at end of file |