Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unable to kill pty process on Windows

オープン
#437 コメント 12 件 リアクション 7 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@deepak1556 がすでに取り組んでいます。

2025年12月19日 から。

評価

この issue はまだ評価されていません。

説明

bug help wanted windows

Environment details

  • OS version: Windows 10 2004
  • Node.js version: 14.15.0
  • node-pty version: 0.9.0

Issue description

Using the simple example script below, I am unable to kill the pty process on Windows 10. However, I can successfully kill the pty process on Ubuntu with the same script and identical versions of Node.js and node-pty.

Test Script

Based on https://github.com/microsoft/node-pty/blob/master/examples/killDeepTree/index.js

var os = require('os');
var pty = require('node-pty');

var shell = process.platform === 'win32' ? 'powershell.exe' : 'bash';

var ptyProcess = pty.spawn(shell, [], {
  name: 'xterm-color',
  cols: 80,
  rows: 30,
  cwd: os.homedir(),
  env: process.env
});

ptyProcess.onData((data) => process.stdout.write(data));

ptyProcess.write('ls\r');

setTimeout(() => {
  console.log('Killing pty');
  ptyProcess.kill();
}, 1000);

Output on Windows

The script hangs on the line "Killing pty" and never returns.

PS C:\Users\Timothy\Projects\test\node-pty-test> node index.js
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\Timothy> ls
...

PS C:\Users\Timothy> Killing pty
Output on Ubuntu

The script finishes and returns to a prompt in the original directory.

timothy@timothy-Virtual-Machine:~/Desktop/node-pty-test$ node index.js
ls
timothy@timothy-Virtual-Machine:~$ ls
...
timothy@timothy-Virtual-Machine:~$ Killing pty
timothy@timothy-Virtual-Machine:~/Desktop/node-pty-test$
主要言語
TypeScript
スター
2k
フォーク
337
平均マージ
13時間 17分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/node-pty のほかの issue

microsoft/node-pty の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。