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.
On Windows I'm starting the IDE from the Command Prompt using 'start netbeans.exe'. When invoked help for the start command 'start /?' it "Starts a separate window to run a specified program or command". In Windows this typically means that a new process independent on the parent console is started. In 6.7, the IDE reuses the parent console for its output: "The launcher has determined that the parent process has a console and will reuse it for its own console output." However, there is no mention about immediately terminating the IDE when the console is closed - in fact depending on the console process. This actually causes several serious problems 1/ The 'start' command should start a separate process independent on the parent console. The IDE changes the intended OS behavior and breaks the 'start' command logic. When Enter is pressed in the console, it shows a standard command prompt and there's no indication that the console controls the IDE. 2/ The message logged into the console just mentions sharing the output. There's no warning that the IDE will immediately terminate when the console is closed. 3/ When the user closes the parent console, the IDE terminates immediately without persisting any unsaved data, which leads to unexpected data loss - this is not an artificial case, it unfortunately happened to me.
I think the correct fix should be not breaking the 'start' command logic - parent console shouldn't be reused by the IDE when started using the 'start' command. If not safely fixable for 6.7 I think there should be a clear warning logged into the parent console that closing it will immediately terminate the IDE without saving any data.
Could be treated as P1 - regression (used to work correctly in 6.5) and data loss (user may lose unsaved work by closing the console). Fortunately, there's an easy workaround by changing the default console-reusing behavior: Use '--console suppress' to suppress console output. Use '--console new' to create a separate console window.
In 6.7 during Win NB launcher rewrite it was decided to join netbeans.exe/nb.exe to single executable netbeans.exe. The idea was that netbeans.exe should behave as console application if started from console and as window application otherwise. Therefore, netbeans.exe by default attaches itself to parent console (if exists) and use it in similar way as nb.exe did (and is terminated as nb.exe was if console is closed). However, there are some limitations (caused by the fact that netbeans.exe is not console application) which cannot be overcome. Additional command line parameters were introduced to be sure all possible use cases are covered. 1) start command creates separate console only for console application which is not case of netbeans.exe. 2) OK, this information will be added. 3) It is the same case as closing console for nb.exe. If you want the exact behavior of old nb.exe (block console it is invoked from, open another console if called by start) you can create nb.bat containing "start /WAIT netbeans.exe %1 %2 %3 %4 %5 %6 %7 %8 %9"
core-main #ecda0e155b45
I'm not sure if the console is really a parent console when the IDE has been started using the 'start' command. I think it's an independent process not related to the IDE. Another problem is that if you press Enter in the console it displays the command prompt and accepts other commands. Any further commands are then messed-up by the IDE output - is it possible to block the console when reused by the IDE?
If you run 'start' command from console, the console is parent process of new started process. As I already wrote, console can be blocked with the help of start command :) 'start /WAIT netbeans.exe'
If you meant if it is possible to block console from within netbeans executable then answer is NO.
Integrated into 'main-golden', will be available in build *200905280201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/ecda0e155b45 User: Tomas Holy <t_h@netbeans.org> Log: #165982: Adding warning to 'attach console' message
Integrated into 'main-golden', will be available in build *200905290201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/31c9af08adba User: Tomas Holy <t_h@netbeans.org> Log: #165982: message tuning
Looks good. Please integrate in release67.
Integrated to release clone http://hg.netbeans.org/release67/rev/c186587c79f3
the warning is there, marking verified. however, it would be really nice, if the IDE behaves normally on the command line - this is not the first issue where the program behaves strangely on the commandline because it 'is not console application'.