Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Dec 21, 2021
2 parents e54082c + ec6c54b commit 19d8b97
Show file tree
Hide file tree
Showing 11 changed files with 338 additions and 209 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# node-pty

[![Build Status](https://dev.azure.com/vscode/node-pty/_apis/build/status/Microsoft.node-pty)](https://dev.azure.com/vscode/node-pty/_build/latest?definitionId=11)
[![Build Status](https://dev.azure.com/vscode/node-pty/_apis/build/status/Microsoft.node-pty?branchName=main)](https://dev.azure.com/vscode/node-pty/_build/latest?definitionId=11&branchName=main)

`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.

Expand Down Expand Up @@ -64,7 +64,7 @@ ptyProcess.write('ls\r');
- [Commas](https://github.com/CyanSalt/commas): A hackable terminal and command runner.
- [ENiGMA½ BBS Software](https://github.com/NuSkooler/enigma-bbs): A modern BBS software with a nostalgic flair!
- [Tinkerun](https://github.com/tinkerun/tinkerun): A new way of running Tinker.
- [Tess](https://github.com/SquitchYT/Tess/): Hackable, simple and rapid terminal for the new era of technology 👍
- [Tess](https://tessapp.dev): Hackable, simple and rapid terminal for the new era of technology 👍
- [NxShell](https://nxshell.github.io/): An easy to use new terminal for Windows/Linux/MacOS platform.

Do you use node-pty in your application as well? Please open a [Pull Request](https://github.com/Tyriar/node-pty/pulls) to include it here. We would love to have it in our list.
Expand Down
72 changes: 45 additions & 27 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,51 @@
}
]
}, { # OS!="win"
'targets': [{
'target_name': 'pty',
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
],
'sources': [
'src/unix/pty.cc'
],
'libraries': [
'-lutil'
],
'conditions': [
# http://www.gnu.org/software/gnulib/manual/html_node/forkpty.html
# One some systems (at least including Cygwin, Interix,
# OSF/1 4 and 5, and Mac OS X) linking with -lutil is not required.
['OS=="mac" or OS=="solaris"', {
'libraries!': [
'-lutil'
]
}],
['OS=="mac"', {
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET":"10.7"
}
}]
]
}]
'targets': [
{
'target_name': 'spawn-helper',
'type': 'executable',
'cflags': ['-Wall'],
'sources': [
'src/unix/spawn-helper.cc',
],
'conditions': [
['OS=="mac"', {
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET":"10.7"
}
}]
]
},
{
'target_name': 'pty',
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
],
'sources': [
'src/unix/pty.cc',
],
'libraries': [
'-lutil'
],
'cflags': ['-Wall'],
'conditions': [
# http://www.gnu.org/software/gnulib/manual/html_node/forkpty.html
# One some systems (at least including Cygwin, Interix,
# OSF/1 4 and 5, and Mac OS X) linking with -lutil is not required.
['OS=="mac" or OS=="solaris"', {
'libraries!': [
'-lutil'
]
}],
['OS=="mac"', {
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET":"10.7"
}
}]
]
}
]
}]
]
}
1 change: 1 addition & 0 deletions scripts/post-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var BUILD_FILES = [
path.join(RELEASE_DIR, 'conpty_console_list.pdb'),
path.join(RELEASE_DIR, 'pty.node'),
path.join(RELEASE_DIR, 'pty.pdb'),
path.join(RELEASE_DIR, 'spawn-helper'),
path.join(RELEASE_DIR, 'winpty-agent.exe'),
path.join(RELEASE_DIR, 'winpty-agent.pdb'),
path.join(RELEASE_DIR, 'winpty.dll'),
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ interface IBasePtyForkOptions {
export interface IPtyForkOptions extends IBasePtyForkOptions {
uid?: number;
gid?: number;
closeFDs?: boolean;
}

export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/native.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface IWinptyNative {
}

interface IUnixNative {
fork(file: string, args: string[], parsedEnv: string[], cwd: string, cols: number, rows: number, uid: number, gid: number, useUtf8: boolean, onExitCallback: (code: number, signal: number) => void): IUnixProcess;
fork(file: string, args: string[], parsedEnv: string[], cwd: string, cols: number, rows: number, uid: number, gid: number, closeFDs: boolean, useUtf8: boolean, onExitCallback: (code: number, signal: number) => void, helperPath: string): IUnixProcess;
open(cols: number, rows: number): IUnixOpenProcess;
process(fd: number, pty: string): string;
resize(fd: number, cols: number, rows: number): void;
Expand Down
5 changes: 5 additions & 0 deletions src/unix/comms.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define COMM_PIPE_FD (STDERR_FILENO + 1)
#define COMM_ERR_EXEC 1
#define COMM_ERR_CHDIR 2
#define COMM_ERR_SETUID 3
#define COMM_ERR_SETGID 4
Loading

0 comments on commit 19d8b97

Please sign in to comment.