pty.js

node.js 的 forkpty(3) 绑定。「Bindings to forkpty(3) for node.js.」

Github星跟踪图

pty.js

forkpty(3) bindings for node.js. This allows you to fork processes with pseudo
terminal file descriptors. It returns a terminal object which allows reads
and writes.

This is useful for:

  • Writing a terminal emulator.
  • Getting certain programs to think you're a terminal. This is useful if
    you need a program to send you control sequences.

Example Usage

var pty = require('pty.js');

var term = pty.spawn('bash', [], {
  name: 'xterm-color',
  cols: 80,
  rows: 30,
  cwd: process.env.HOME,
  env: process.env
});

term.on('data', function(data) {
  console.log(data);
});

term.write('ls\r');
term.resize(100, 40);
term.write('ls /\r');

console.log(term.process);

Todo

  • Add tcsetattr(3), tcgetattr(3).
  • Add a way of determining the current foreground job for platforms other
    than Linux and OSX/Darwin.

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. </legalese>

License

Copyright (c) 2012-2015, Christopher Jeffrey (MIT License).

主要指标

概览
名称与所有者chjj/pty.js
主编程语言C++
编程语言Makefile (语言数: 4)
平台Linux, Mac
许可证MIT License
所有者活动
创建于2012-02-21 20:32:10
推送于2019-04-30 00:01:55
最后一次提交2016-07-06 22:24:40
发布数30
最新版本名称v0.3.1 (发布于 )
第一版名称v0.0.1 (发布于 )
用户参与
星数865
关注者数34
派生数210
提交数290
已启用问题?
问题数137
打开的问题数76
拉请求数28
打开的拉请求数12
关闭的拉请求数25
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?