installed pty
[VSoRC/.git] / node_modules / node-pty / src / conpty_console_list_agent.ts
1 /**
2  * Copyright (c) 2019, Microsoft Corporation (MIT License).
3  *
4  * This module fetches the console process list for a particular PID. It must be
5  * called from a different process (child_process.fork) as there can only be a
6  * single console attached to a process.
7  */
8
9 let getConsoleProcessList: any;
10 try {
11   getConsoleProcessList = require('../build/Release/conpty_console_list.node').getConsoleProcessList;
12 } catch (err) {
13   getConsoleProcessList = require('../build/Debug/conpty_console_list.node').getConsoleProcessList;
14 }
15
16 const shellPid = parseInt(process.argv[2], 10);
17 const consoleProcessList = getConsoleProcessList(shellPid);
18 process.send({ consoleProcessList });
19 process.exit(0);