Community
Participate
Working Groups
Created attachment 138645 [details] patch adding functionality to the telnet console Currently the telnet console is not user-friendly. Here I provide a patch, which adds some features to the telnet console, which make it easier to use. The patch provides history and line editing - deletion with the del and backspace keys, insert/replace, movement with the left and right arrow.
The patch uses J2SE 1.5 for loops and generics. Can you provide a patch that can compile against the OSGi minimum 1.2 execution environment?
Created attachment 138754 [details] patch adding functionality to the telnet console, compliant with OSGi minimum 1.2 The previously submitted patch, but compliant with OSGi minimum 1.2
Hi Tom, any update on this? Cheers, Bernd
I will put this on my plate to review for M2.
Thanks!
Created attachment 145585 [details] console session patch This is a great idea. But I am reluctant to add so much code to the core framework console implementation. Here is an alternate proposal. This patch adds a new API to the console (ConsoleSession service). This service allows anyone to publish a console session service which provides the input/output to a console session in any way they want. I think this is a good thing to do because: 1) It finally removes the silly restriction of only allowing one console session at a time. 2) It is very flexible in allowing advanced front ends to provide the session input and output (I will attach a project that uses your code to provide the added functionality you want in another bundle). 3) It opens up the framework console so that it can be connected to by PDE, something I know Chris has been wanting to do for some time now.
Created attachment 145587 [details] telnet example bundle Here is the separate telnet bundle. In order for this to work you have to use the -console option to enable the basic console support in the framework. If we go this route then we would have to make this work without specifying -console I think.
Created attachment 145621 [details] org.eclipse.pde.ui.console Here's a quick bundle that contributes a dummy console Tom. If you can hook the output and inputstream's to the bundle, I think we're golden. I didn't have time to do it tonight but hopefully it's enough to get you started. If you selfhost with this bundle and your patch, you should notice an "OSGi Console" available to you in the Console view.
If we refine the code enough, I'd be willing to have it in PDE. It would be useful for some plug-in developers ;)
(In reply to comment #7) > Created an attachment (id=145587) [details] > telnet example bundle > > Here is the separate telnet bundle. In order for this to work you have to use > the -console option to enable the basic console support in the framework. If > we go this route then we would have to make this work without specifying > -console I think. > I am fine with this solution. My only concern is that if the telnet service listens on an arbitrary port (the server socket is created to listen on any free port), then it may happen that the user does not know on which port to connect to with telnet. Is the telnet service going to be included in the framework, as part of the console, or not?
(In reply to comment #10) > I am fine with this solution. > > My only concern is that if the telnet service listens on an arbitrary port (the > server socket is created to listen on any free port), then it may happen that > the user does not know on which port to connect to with telnet. > > Is the telnet service going to be included in the framework, as part of the > console, or not? > We would keep the current functionality of the console where the built-in input/output comes from the System.in/System.out or from the dinky and brain dead telnet server (using -console <port>). The beauty of this solution is that you can build a more sophisticated telnet front end that does everything you want. In my example, I just used port 0 for simplicity, but you can get a configuration port from what ever source you want (simple thing would be to use BundleContext.getProperty("fancy.telnet.port")). This layered approach is much better because we don't have to build into the framework every new function that others may want. For example, we have had requests for user login over telnet and for a secure/encrypted connection. That is nothing we would want to build into the framework. But if it is built on top in a separate bundle then we give developers the freedom to do what they need.
Created attachment 145710 [details] updated pde.ui.console Here is an updated pde.ui.console. I hooked it into a ConsoleSession. I modified it a bit to allow for multiple OSGiConsoles to be created. This was just for testing, I'm not sure it makes sense to allow multiple consoles to be created. To disconnect from a console you use the disconnect command. That will remove the console from the view.
Created attachment 145714 [details] updated framework patch Here is an updated patch that enables console sessions even when -console is not specified. I also allow for "-console none" to be used to disable all console sessions.
Created attachment 145866 [details] updated framework patch A few more tweaks to javadoc and the implementation. I plan to release this patch to HEAD.
I released the patch, with one addition to update the version of the exported console package. I renamed the summary to more accurately reflect the solution.
I'll work on creating a patch against PDE UI for the console functionality.
*** Bug 162415 has been marked as a duplicate of this bug. ***