microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.46k stars 235 forks source link

on close does not fire when exiting cmd.exe? #485

Closed Zibri closed 2 years ago

Zibri commented 3 years ago

Environment details

Issue description

I use: mycmd=pty.spawn("cmd.exe", [], { name: 'xterm-color', cols: 80, rows: 25, env: process.env });

if I then exit cmd.exe the event mycmd.on('close', ()=>console.log("exited"))

does not fire. why?

how to cathe cmd exit? on linux the same code, running bash works.

Zibri commented 3 years ago

nevermind... on('exit' works.. then I wonder what is the difference between onclose and onexit.

Tyriar commented 2 years ago

duplicate of https://github.com/microsoft/node-pty/issues/369