Hi everyone.
I'm building a cross-platform ElectronJS App by using XtermJS and node-pty. I needed to stop command execution(same as CTRL+C) by clicking on a button. ptyProcess.write('\x03'); worked pretty well in the Unix(MacOS - bash) but in windows(powershell) it showed an error message. So, I changed to ptyProcess.kill('SIGINT') in windows. Looks like it's kinda working but because of the terminate confirmation(Terminate batch job? (Y/N)?) It is not stopping the command execution properly. How can we exit previous command properly and make command line ready to execute the next command?
Here's the part of the code that I used to stop command execution:
ipcMain.on('stop-terminal-process', e => { if(os.platform() !== "win32"){ ptyProcess.write('\x03'); } else { ptyProcess.kill('SIGINT'); //ptyProcess.kill('SIGBREAK'); //ptyProcess.write('Y \r'); } })
Environment details
Issue description
Hi everyone. I'm building a cross-platform ElectronJS App by using XtermJS and node-pty. I needed to stop command execution(same as CTRL+C) by clicking on a button.
ptyProcess.write('\x03');
worked pretty well in the Unix(MacOS - bash) but in windows(powershell) it showed an error message. So, I changed toptyProcess.kill('SIGINT')
in windows. Looks like it's kinda working but because of the terminate confirmation(Terminate batch job? (Y/N)?
) It is not stopping the command execution properly. How can we exit previous command properly and make command line ready to execute the next command?Here's the part of the code that I used to stop command execution:
ipcMain.on('stop-terminal-process', e => { if(os.platform() !== "win32"){ ptyProcess.write('\x03'); } else { ptyProcess.kill('SIGINT'); //ptyProcess.kill('SIGBREAK'); //ptyProcess.write('Y \r'); } })
Note: SIGBREAK did not work too.