### Install and Start Electron Example Source: https://github.com/microsoft/node-pty/wiki/Releasing-node-pty After updating the node-pty version in electron/package.json, run these commands in the examples/electron directory to install dependencies and start the application. ```bash ./npm_install.sh npm start npm test ``` -------------------------------- ### Install and Launch Terminal Application Source: https://github.com/microsoft/node-pty/blob/main/examples/electron/README.md Use these commands to install platform-specific dependencies and start the Electron application. ```bash # Install dependencies (Windows) ./npm-install.bat # Install dependencies (non-Windows) ./npm-install.sh # Launch the app npm start ``` -------------------------------- ### Test node-pty Example Source: https://github.com/microsoft/node-pty/wiki/Releasing-node-pty Execute the example script to test the functionality of node-pty after making changes. ```bash node ./examples/fork/index.js ``` -------------------------------- ### Run Electron Example Source: https://github.com/microsoft/node-pty/blob/main/CONTRIBUTING.md Use these commands to launch the electron-based testing environment. ```sh cd examples/electron npm ci npm start ``` -------------------------------- ### Setup xterm.js Environment Source: https://github.com/microsoft/node-pty/blob/main/CONTRIBUTING.md Commands to clone and prepare the xterm.js repository for local testing. ```sh git clone https://github.com/xtermjs/xterm.js npm ci npm run setup ``` -------------------------------- ### Install Dependencies and Build Source: https://github.com/microsoft/node-pty/blob/main/README.md Installs project dependencies and builds the C++ addons, followed by compiling TypeScript to JavaScript. This is a standard build process for the node-pty project. ```bash # Install dependencies and build C++ npm install # Compile TypeScript -> JavaScript npm run build ``` -------------------------------- ### Install Windows Build Tools Source: https://github.com/microsoft/node-pty/blob/main/README.md Command to install necessary build tools for Windows environments via PowerShell. ```sh npm install --global --production windows-build-tools ``` -------------------------------- ### Install Build Tools on Linux Source: https://github.com/microsoft/node-pty/blob/main/README.md Installs necessary build tools on Debian-based Linux systems using apt. This includes make, python, and build-essential, which are required for compiling native addons. ```bash sudo apt install -y make python build-essential ``` -------------------------------- ### Build and Run xterm.js Demo Source: https://github.com/microsoft/node-pty/blob/main/CONTRIBUTING.md Scripts to compile TypeScript, bundle assets, and start the local demo server. ```sh npm run tsc-watch # build ts npm run esbuild-watch # bundle ts/js npm run esbuild-demo # build demo/server npm run start # run server ``` -------------------------------- ### Run Manual Test for Nested Process Termination Source: https://github.com/microsoft/node-pty/blob/main/examples/killDeepTree/README.md Install dependencies and execute the test script to verify process tree cleanup behavior. ```bash npm i node index.js ``` -------------------------------- ### Start Execution in WinDbg Source: https://github.com/microsoft/node-pty/wiki/Debugging This command tells WinDbg to continue execution until the next breakpoint is hit. It's typically used after setting breakpoints. ```debugger g ``` -------------------------------- ### Spawn a Pseudoterminal Process Source: https://github.com/microsoft/node-pty/blob/main/README.md Spawns a pseudoterminal process, determining the appropriate shell based on the operating system. This snippet demonstrates basic setup for interacting with the terminal, including event handling for data, writing commands, and resizing. ```javascript import * as os from 'node:os'; import * as pty from 'node-pty'; const shell = os.platform() === 'win32' ? 'powershell.exe' : 'bash'; const ptyProcess = pty.spawn(shell, [], { name: 'xterm-color', cols: 80, rows: 30, cwd: process.env.HOME, env: process.env }); ptyProcess.onData((data) => { process.stdout.write(data); }); ptyProcess.write('ls\r'); ptyProcess.resize(100, 40); ptyProcess.write('ls\r'); ``` -------------------------------- ### Pull and Build node-pty Source: https://github.com/microsoft/node-pty/wiki/Releasing-node-pty Run these commands in your local node-pty folder to pull the latest changes, clean the directory, and install/watch dependencies. ```bash git pull git clean -xfd yarn && yarn watch ``` -------------------------------- ### Enable Winpty Agent Console Source: https://github.com/microsoft/node-pty/wiki/Debugging Set this environment variable to 1 to show the winpty agent console window. This is helpful for debugging winpty itself. ```shell WINPTY_SHOW_CONSOLE=1 ``` -------------------------------- ### List Loaded Modules in WinDbg Source: https://github.com/microsoft/node-pty/wiki/Debugging Use this command to list all loaded modules in the current debugging session. Verify that pty.node is present in the list. ```debugger lm ``` -------------------------------- ### Commit and Push node-pty Changes Source: https://github.com/microsoft/node-pty/wiki/Releasing-node-pty Commit your release changes with a descriptive message and push them to the repository. ```bash git commit -m "release number" git push ``` -------------------------------- ### Examine Function in WinDbg Source: https://github.com/microsoft/node-pty/wiki/Debugging This command displays information about a specific function, such as its address and signature. It's useful for understanding function details before setting breakpoints. ```debugger x pty!PtyStartProcess ``` -------------------------------- ### Link node-pty to xterm.js Source: https://github.com/microsoft/node-pty/blob/main/CONTRIBUTING.md Commands to remove the existing node-pty module and create a symbolic link to the local development version. ```sh rm -rf node_modules/node-pty # in xterm.js folder ln -s /node_modules/node-pty ``` -------------------------------- ### Configure Flow Control Source: https://github.com/microsoft/node-pty/blob/main/README.md Enables automatic flow control in the pty process to pause and resume child programs using XON/XOFF control codes. ```js const PAUSE = '\x13'; // XOFF const RESUME = '\x11'; // XON const ptyProcess = pty.spawn(shell, [], {handleFlowControl: true}); // flow control in action ptyProcess.write(PAUSE); // pty will block and pause the child program ... ptyProcess.write(RESUME); // pty will enter flow mode and resume the child program // temporarily disable/re-enable flow control ptyProcess.handleFlowControl = false; ... ptyProcess.handleFlowControl = true; ``` -------------------------------- ### Set WinDbg Breakpoint on pty.node Load Source: https://github.com/microsoft/node-pty/wiki/Debugging Use this command in WinDbg to break execution when the pty.node module is loaded. This is useful for inspecting the module immediately after it's loaded. ```debugger sxe ld pty ``` -------------------------------- ### Reload Symbols in WinDbg Source: https://github.com/microsoft/node-pty/wiki/Debugging This command forces WinDbg to reload symbols for all loaded modules. It's often necessary after loading new modules or making changes to symbol paths. ```debugger .reload /f ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.