microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.43k stars 232 forks source link

How do I gracefully close the terminal? #549

Closed MassMessage closed 1 year ago

MassMessage commented 2 years ago

Environment details

Issue description

let's say I have a pseudo-terminal (using xterm.js) in my application, connect to a real-terminal (powershell) through node-pty. the user happens to close it (it's inside a tab), so I need to "close" the terminal "connection" with powershell. What's the proper way to do this? call kill()? send exit to the terminal run? regard to cleaning resources, is there anything I do need to release?

Tyriar commented 1 year ago

kill is the way to do this currently, though there are issues on Windows with clean up that's tracked in an issue on microsoft/terminal