This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250245 - ctrl-c is filtered which is given as hint to stop npm script
Summary: ctrl-c is filtered which is given as hint to stop npm script
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-05 19:22 UTC by everflux
Modified: 2015-10-28 02:23 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
showing ctrl-c (22.16 KB, image/png)
2015-02-06 18:14 UTC, everflux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description everflux 2015-02-05 19:22:56 UTC
When using 'npm scripts' and running the angular-seed project "CTRL-C" is given as output to stop the server.
This sequence seems to be filtered from the "Run" window, so stopping does not work.

Using the red stop button works, though.
Comment 1 Tomas Mysik 2015-02-06 06:45:06 UTC
@jhavlin: Jardo, could you please advice? Thanks.
Comment 2 Jaroslav Havlin 2015-02-06 12:30:11 UTC
Output Window is not a terminal emulator. It just displays redirected output of some process, but it does not control the process.

Who gives "CTRL-C" as output, the user or the script running in output window?

Can you please provide steps to reproduce? Or sample project?
I'm sorry, I'm not very familiar with HTML projects, so maybe I don't understand the problem correctly.
Thank you.
Comment 3 everflux 2015-02-06 18:14:03 UTC
Created attachment 151869 [details]
showing ctrl-c

This is the output from:
- Rightclick on project
- npm scripts -> start
(effectively calling '/usr/bin/npm run-script start')

Does this help to get the context?
Comment 4 Tomas Mysik 2015-02-09 06:56:42 UTC
@reporter: Please, provide exact steps to reproduce, step by step. E.g.:

- start NetBeans
- run this
- click there
- press Enter
- type XYZ
- ...

-> expected: ...
-> actual: ...

Simply reopen this issue, thanks.
Comment 5 everflux 2015-02-10 20:20:36 UTC
Hope this helps:

Start netbeans
Create a new html5/javascript project
Site Template: Download online template > angularjs seed
right click project > npm scripts > start

Last lines:


Starting up http-server, serving ./ on port: 8000
Hit CTRL-C to stop the server


I assume "ctrl-c" is caught as 'copy' shortcut.
Comment 6 Jaroslav Havlin 2015-02-11 06:40:06 UTC
Thank you very much.
The problem is that the process behaves as if it was started in terminal, which sends sigkill when Ctrl+C is pressed, but Output Window is not a terminal, it just shows redirected output of the process.

We can mimic this behavior by having Ctrl+C shortcut for the stop button (if no text is selected, maybe with showing a confirmation dialog "Really stop process?").

Reassigning to platform/Output Window.
Comment 7 Tomas Mysik 2015-02-11 07:45:44 UTC
Sounds good to me. Thanks.
Comment 8 Jaroslav Havlin 2015-10-26 17:34:47 UTC
http://hg.netbeans.org/core-main/rev/6777b7f1144e
Fixed.

We may also consider starting the npm script in terminal emulator, but it would require larger changes in module javascript.nodejs.

Thank you for help.
Comment 9 Quality Engineering 2015-10-28 02:23:59 UTC
Integrated into 'main-silver', will be available in build *201510280002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6777b7f1144e
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #250245: CTRL+C in Output Window invokes Stop action