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 86984 - I/O window does not work correctly when running an application
Summary: I/O window does not work correctly when running an application
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
: 87345 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-12 05:39 UTC by Ann Rice
Modified: 2006-11-14 00:49 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ann Rice 2006-10-12 05:39:31 UTC
The external I/O window that opens when debugging an application does not open
when you run the application outside the debugger. For example, if you run the
Quote application, the cout messages are displayed in the Output window of the
IDE, and input must be entered in the Input field of the Output window. But the
input and output are out of synch, so the input prompts do not appear until
after input is entered.
Comment 1 Nikolay Molchanov 2006-10-12 06:56:50 UTC
Ann, I think it is intentionally implemented this way. When a program runs 
under debugger, it runs with a real terminal window, which is external I/O
window. When it runs without debugger, it runs with built-in output window.
I agree that there is some kind of inconsistency, and I think you suggest
to use external I/O window by default in both cases, correct? If yes, this 
is not a DEFECT, but mostly a request for ENHANCEMENT, because both modes 
can be useful for users, and we shall provide a project property to specify 
which mode user wants - internal or external program I/O window.
Another problem ("input and output are out of synch") has its own IZ: 76173
http://www.netbeans.org/issues/show_bug.cgi?id=76173
Comment 2 Nikolay Molchanov 2006-10-12 08:26:11 UTC
I assigned this bug to myself just in case we decide to change the default
and use external I/O window for execution without debugging. If we do not
plan to implement it for this release, I'll downgrade the priority.
Comment 3 julieg 2006-10-12 19:50:46 UTC
this bug should be fixed by CND1-FCS.
Comment 4 Nikolay Molchanov 2006-10-13 05:17:26 UTC
We discussed this issue today (Gordon, Thomas, Nik) and decided not to fix it
for Beta 3 (so priority is downgraded to P2). For FCS we decided to provide
the following solution:

1. Implement "execution with external terminal" as an option. By default
   program will use the existing built-in Program I/O window.

2. Implement a new project property:
   Use External Terminal    [ ]   (default value is "Disabled").

3. If user enabled "Use External Terminal" property, program will run with
   "xterm" on Unix (Solaris and Linux), and with "cmd.exe" on Windows.

Note: It is still not known how to run a program with "cmd.exe" on Windows
(in debugging mode gdb creates "cmd.exe" window)

Comment 5 _ gordonp 2006-10-13 16:45:15 UTC
Lets have a UI design meeting before you make changes. While I agree in
general with your last IZ update, I don't agree with all the specifics.
But now isn't the time to discus them (sometime after beta3 would be better).
Comment 6 Nikolay Molchanov 2006-10-13 17:50:36 UTC
Yes, of course, a UI design meeting before making changes would be very helpful.
If you have any specific comments, objections, suggestions, ... - please add
them to this IZ, so we all will have some time to think about it.
Comment 7 _ gordonp 2006-10-17 16:25:49 UTC
*** Issue 87345 has been marked as a duplicate of this issue. ***
Comment 8 Nikolay Molchanov 2006-10-17 18:25:30 UTC
Added comments from  IZ 87345, which was closed as duplicate of this IZ:

------------------------ alexandrov wrote: -----------------------------
Open Quote sample project. Run project(F6). Project ask to enter customer name,
but you will see it only after input this name. Next commands of this project
also appear only after their execution. After all we receive "Run failed"...
Try debug the project(F5). Here commands appear in external console before you
execute them :) Final command is "To quit enter Q". Enter it in external
console, but you will not quit(for Linux and Solaris. For Windows you will).
Type "q" in Command textfield of the internal debugger console. Then you will
quit from program(it is abnormal behavior), but debugger session will still
alive(you will see "user program running"). Step, continue, finish debugger
session buttons are active, but debugger console(gdb) were closed.
---------------------------------------------------------------------------
Comment 9 _ gordonp 2006-10-24 20:49:03 UTC
UI Design for 86984

Define 2 properties on the Running node of Project Properties:

    1st property is a dropdown menu named "Console Type":

	3 choices:
	    1st value:
		"Default" [for cnd1 this should be "External Terminal"]
	    2nd value:
		"External Terminal"
	    3rd value:
		"Output Window (Input only)"


    2nd property is a dynamic dropdown menu named "Terminal Type":

	    Possible Values:
		Unix choices:
		    "Default"
		    Do path searches on "gnome-terminal", "konsole", and
			"xterm" and include any/all found. Note: If you
			know what the terminal name on a Mac is feel free
			to include it in this list. Show just the name
			but exec by path.
		Windows choice (only 1 choice, for cnd1):
		    "Command Window"


    Property Descriptions:

	The properties in project properties have a textual description
	field below the actual properties. If you select the property
	name the description is displayed (r/o) in the description field.
	Currently we *really* botch this and typically show only the
	property name. You should provide a real description for both
	properties.

    
Execution Behavior:
    The Run Project and Run Main Project actions should run the exe from
    the choice given by the Console Type property. If its set to External
    Terminal then the appropriate terminal should be execed.
Comment 10 Nikolay Molchanov 2006-10-26 23:10:07 UTC
I assume that Gordon is working on this issue, so I removed my name from RE.
Comment 11 _ gordonp 2006-10-27 00:21:13 UTC
Use case:

  1. User wants to run a simple program which prints a prompt, waits for
     a numeric input, and prints the number
  2. After setting up the project, user selects Run->Run Main Project
  3. The user had not changed either of the properties mentioned above.
     The default console type is external so the program is started with
     the default terminal type for that platform (this *is* platform dependent
     so I don't say what the default is). Lets assume gnome-terminal is the
     default (if found on the user's path), konsole if gnome-terminal wasn't
     found but konsole is, and xterm if neither was found but xterm is. If
     none of these are look for them in /usr/bin and /usr/X11/bin and take
     the 1st one found.
  4. The program runs in a gnome-terminal, prints the prompt, and the user
     types a number and presses Return.
  5. The number is printed in the gnome-terminal

The overall behavior (other than the properties to choose the terminal program)
are similar to gdb-lite.
Comment 12 _ gordonp 2006-11-06 19:18:20 UTC
Assigning to myself.
Comment 13 _ gordonp 2006-11-14 00:49:53 UTC
There are UI changes associated with this fix. First off, 2 new properties
have been created on the project Running node. The 1st propertyis "Console
Type" and it can have values of "Default", "External Terminal", or "Output
Window (input only)". The Default is currently External Terminal.

This controls where a project runs with respect to I/O. If external, a terminal
emulator is started and I/O is to/from that terminal. The 2nd property controls
which terminal emulator to use. The name of this property is "Terminal Type".

On Windows, there is only 1 real choice (there "Default" and "Command Window"
selections in the menu, but both start a command window).

On Unix, we look for gnome-terminal, konsole, or xterm and provide as many
of those as found. The default is the 1st of those found. We search the users
path, but also append various locations these programs are often found. There
is not enough consistency between different Unix* to have a single default!

This fix impacts UI because a window is now started in the default cases when
a program is run. Its a big in-your-face, but since the NetBeans output window
doesn't handle input properly (do I need to look up the IZs we've filed on
this:-), this is the temporary solution we've implemented. Note that this is
the solution Microsoft's Visual Studio uses.