Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Zibri opened this issue Aug 7, 2021 · 2 comments
Closed

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

Zibri opened this issue Aug 7, 2021 · 2 comments

Comments

@Zibri
Copy link

Zibri commented Aug 7, 2021

Environment details

  • OS: windows
  • OS version: 10
  • node-pty version: latest

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
Copy link
Author

Zibri commented Aug 7, 2021

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

@Tyriar
Copy link
Member

Tyriar commented Oct 21, 2021

duplicate of #369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants