Jump to content

Can't exit Node-Red (in console window) with CTRL+C


Go to solution Solved by mistersquirrle,

Recommended Posts

Posted

I run Node-Red (it's a console app) with this command:

Run(@ComSpec & " /k node-red")

If I run node-red by typing "node-red" into a console I can exit/quit node-red by pressing CTRL+C, but when it's started by AutoIt, CTRL+C does nothing.

Anyone know why or how to get CTRL+C working?

Posted
1 minute ago, ioa747 said:

but win close is Alt + F4   CTRL+C is for copy ?

It's a console app -- most console apps (including Node-Red) are quit using CTRL+C

  • Solution
Posted

I think that this is an issue with how running an uncompiled script works in AutoIt. You can test the issue with this:
 

#include <AutoItConstants.au3>
Local $iPid = Run(@ComSpec & ' /k ping 127.0.0.1 -t ', '', @SW_SHOW, $RUN_CREATE_NEW_CONSOLE)

If you run that from SciTE and try to do Ctrl + c to cancel it, or Ctrl + BREAK, neither work and the ping continues. However, if you set the flag

#AutoIt3Wrapper_Change2CUI=y

And then compile the script and run it, you ARE able to cancel it with Ctrl + c. So I think that if you're looking for that Ctrl + c functionality, just keep in mind that you'll need to compile the script to get it. Here's my full test:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include-once
#include <AutoItConstants.au3>
Local $iPid = Run(@ComSpec & ' /k ping 127.0.0.1 -t ', '', @SW_SHOW, $RUN_CREATE_NEW_CONSOLE)

 

We ought not to misbehave, but we should look as though we could.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...