forkpty(3) bindings for node.js. This allows you to fork processes with pseudoterminal file descriptors. It returns a terminal object which allows reads and writes.
This is useful for:
- Writing a terminal emulator (eg. via xterm.js).
- Getting certain programs to think you're a terminal, such as when you need a program to send you control sequences.
node-pty powers many different terminal emulators, including:
- Microsoft Visual Studio Code
- Script Runner for Atom.
- FreeMAN file manager
- atom-xterm - Atom plugin for providing terminals inside your Atom workspace.
- Termination - Another Atom plugin that provides terminals inside your Atom workspace.
Do you use node-pty in your application as well? Please open a Pull Request to include it here. We would love to have it in our list.
var os = ;var pty = ;var shell = osplatform === 'win32' ? 'powershell.exe' : 'bash';var ptyProcess = pty;ptyProcess;ptyProcess;ptyProcess;ptyProcess;
sudo apt install -y make python build-essential
npm install requires some tools to be present in the system like Python and C++ compiler. Windows users can easily install them by running the following command in PowerShell as administrator. For more information see https://github.com/felixrieseberg/windows-build-tools:
npm install --global --production windows-build-tools
The Windows SDK is also needed which can be downloaded here. Only the "Desktop C++ Apps" components are needed to be installed.
The wiki contains instructions for debugging node-pty.
All processes launched from node-pty will launch at the same permission level of the parent process. Take care particularly when using node-pty inside a server that's accessible on the internet. We recommend launching the pty inside a container to protect your host machine.
Note that node-pty is not thread safe so running it across multiple worker threads in node.js could cause issues.
Powershell gives error 8009001d
Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 8009001d.
This happens when PowerShell is launched with no
SystemRoot environment variable present.
This project is forked from chjj/pty.js with the primary goals being to provide better support for later Node.JS versions and Windows.
Copyright (c) 2012-2015, Christopher Jeffrey (MIT License).
Copyright (c) 2016, Daniel Imms (MIT License).
Copyright (c) 2018, Microsoft Corporation (MIT License).