Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328566 - Add TAB completion and command History to Virgo console
Summary: Add TAB completion and command History to Virgo console
Status: CLOSED FIXED
Alias: None
Product: Virgo
Classification: RT
Component: unknown (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0.0.M01   Edit
Assignee: Hristo Iliev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 02:51 EDT by Hristo Iliev CLA
Modified: 2011-02-03 09:38 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch for enhanced telnet support over the equinox console (160.84 KB, patch)
2011-01-21 09:49 EST, Lazar Kirchev CLA
no flags Details | Diff
Documentation patch for the telnet enhancement patch (3.50 KB, application/octet-stream)
2011-01-21 09:50 EST, Lazar Kirchev CLA
no flags Details
Proposed patch for enhanced telnet support over the equinox console (196.35 KB, application/octet-stream)
2011-01-25 11:00 EST, Lazar Kirchev CLA
no flags Details
Documentation patch for the telnet enhancement patch (5.60 KB, application/octet-stream)
2011-01-25 11:01 EST, Lazar Kirchev CLA
no flags Details
Proposed patch for enhanced telnet support over the equinox console (164.31 KB, patch)
2011-01-27 08:54 EST, Lazar Kirchev CLA
glyn.normington: iplog+
glyn.normington: review+
Details | Diff
Documentation patch for the telnet enhancement patch (6.23 KB, patch)
2011-01-27 08:57 EST, Lazar Kirchev CLA
glyn.normington: iplog+
glyn.normington: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hristo Iliev CLA 2010-10-25 02:51:47 EDT
Build Identifier: 

A solution exists [1] that can provide TAB completion and commands history to the Virgo console. This code should be integrated to Virgo to overcome the limitations of Equinox implementation.

Currently the bundle can be used in latest versions of Virgo [2].

The current implementation of this features has some limitations:
1) no tab completion for command parameters
2) special characters do not work without configuration

Testing the dm Server console (using JLine) proved that the special characters do not work there either. The problem is that JLine (and the implementation we have) relies on the host operating system to detect the special characters. In case of incoming telnet connection these characters are not necessary the same as on the host OS. This causes the console to look as malfunctioning - it does not accept backspace for instance and the command history is not working since the arrow keys are not recognized.

A research we made showed that detection of the client terminal key bindings is possible. Therefore a implementation that detects the bindings should solve the problem with the special keys.

The tab completion of commands parameters is dependant on the command interface used. It can be implemented in the same (or at least similar) way to the one present in dm Server.


[1] http://dev.eclipse.org/mhonarc/lists/virgo-dev/msg00254.html
[2] http://dev.eclipse.org/mhonarc/lists/virgo-dev/msg00257.html

Reproducible: Always
Comment 1 Lazar Kirchev CLA 2011-01-21 09:49:05 EST
Created attachment 187287 [details]
Proposed patch for enhanced telnet support over the equinox console

This patch provides the following improvements of the equinox telnet:

- telnet terminal type negotiation
- command line editing (commands history, backspace, delete, arrows, pgup, pgdown, home, end, insert)
- grep command
- simple command completion

The bundle is a framework extension.
Comment 2 Lazar Kirchev CLA 2011-01-21 09:50:07 EST
Created attachment 187288 [details]
Documentation patch for the telnet enhancement patch

This patch provides documentation for the telnet supportability patch.
Comment 3 Glyn Normington CLA 2011-01-24 04:50:02 EST
Some comments on the proposed patch in attachment 187287 [details].

1. The Virgo convention is to end testcase classes in "Tests" rather than "Test".

2. The code needs reformatting to match Virgo conventions, e.g. the method scanNegotiation contains larger indentation than is normal. Please see http://wiki.eclipse.org/Virgo/Committers/Coding.

3. There are some mysterious integer literals in the tests, such as 100. It is probably worth defining constants for these to make it clear whether there is something special about 100 or it was just an example value.

Other than that the code is reasonably structured and I gather the test coverage is good.

I note that the diagnostics are pretty low level, but this is necessary if the code is going to reside in the OSGi extensions git repository since this may not depend on medic.
Comment 4 Glyn Normington CLA 2011-01-24 04:54:41 EST
Comments on the proposed documentation patch in attachment 187288 [details]: this all looks good, but the section "Securing the Equinox Console" talks about how to configure osgi.console and also presumes that it is set (to 2401) by default, whereas in Virgo it is switched off by default. The configuration information should probably be moved to the configuration chapter of the user guide and, if necessary, a cross-reference can be made.
Comment 5 Glyn Normington CLA 2011-01-24 04:56:13 EST
Please note that once these patches have been reworked, a Virgo committer will need to raise a CQ as they contain more than 250 LOCs.
Comment 6 Lazar Kirchev CLA 2011-01-25 11:00:30 EST
Created attachment 187527 [details]
Proposed patch for enhanced telnet support over the equinox console

I attach the patch with the corrected code.
Comment 7 Lazar Kirchev CLA 2011-01-25 11:01:19 EST
Created attachment 187529 [details]
Documentation patch for the telnet enhancement patch

I attache the patch with the corrected documentation.
Comment 8 Glyn Normington CLA 2011-01-26 04:27:38 EST
Attachment 187527 [details] is fine except that .settings files such as org.eclipse.jdt.ui.prefs should not be checked in.

Attachment 187529 [details] is also better now, but I would like the new configuration section to be linked from the definition of the osgi.console property in the table entitled "User Region Configuration Properties" in http://www.eclipse.org/virgo/documentation/virgo-documentation-2.1.0.RELEASE/docs/virgo-user-guide/htmlsingle/virgo-user-guide.html#configuring-kernel.

(Please note that the osgi.console property will move to the kernel launch properties in due course as part of the change to implement the user region in terms of framework hooks rather than a nested framework with its  own framework properties. So I should be careful to move the documentation of the property too.)
Comment 9 Lazar Kirchev CLA 2011-01-27 08:54:47 EST
Created attachment 187730 [details]
Proposed patch for enhanced telnet support over the equinox console

Update for the patch.
Comment 10 Lazar Kirchev CLA 2011-01-27 08:57:25 EST
Created attachment 187731 [details]
Documentation patch for the telnet enhancement patch

Update of the documentation patch.
Comment 11 Glyn Normington CLA 2011-01-28 04:29:42 EST
CQ 4859 raised to cover the contribution.
Comment 12 Glyn Normington CLA 2011-01-28 10:25:59 EST
(In reply to comment #11)
> CQ 4859 raised to cover the contribution.

CQ is approved. This patch can be applied as soon as a committer has the time to apply it and run the tests.
Comment 13 Lazar Kirchev CLA 2011-01-28 10:27:11 EST
(In reply to comment #12)
> (In reply to comment #11)
> > CQ 4859 raised to cover the contribution.
> 
> CQ is approved. This patch can be applied as soon as a committer has the time
> to apply it and run the tests.

Thanks Glyn!

Regards,
Lazar
Comment 14 Hristo Iliev CLA 2011-01-28 15:55:56 EST
Coverage results:

org.eclipse.virgo.osgi.console.common (85,6%)
  ConsoleInputStream 	(89,4%)
  ConsoleOutputStream 	(78,7%)
  InputHandler 	(90,5%)
  Scanner 	(92,5%)
  SimpleByteBuffer 	(83,2%)
org.eclipse.virgo.osgi.console.supportability (86,1%)
  CommandCompleter 	(100%)
  CommandCompleter.CommandProviderCustomizer 	(50%)
  ConsoleInputHandler 	(100%)
  ConsoleInputScanner 	(85%)
  Grep 	(89,7%)
  HistoryHolder 	(92,2%)
org.eclipse.virgo.osgi.console.telnet (85,7%)
  ANSITerminalTypeMappings 	(100%)
  NegotiationFinishedCallback 	(100%)
  SCOTerminalTypeMappings 	(100%)
  TelnetConsoleSession 	(90,4%)
  TelnetInputHandler 	(100%)
  TelnetInputScanner 	(81,6%)
  TelnetManager 	(86,5%)
  TelnetManager.ConsoleSocketGetter 	(72,2%)
  TelnetOutputStream 	(100%)
  TerminalTypeMappings 	(92,9%)
  VT100TerminalTypeMappings 	(100%)
  VT220TerminalTypeMappings 	(100%)
  VT320TerminalTypeMappings 	(100%)
org.eclipse.virgo.osgi.console.telnet.hook (88,9%)
  TelnetHook 	(88,2%)
  TelnetHookConfigurator 	(100%)
Comment 15 Hristo Iliev CLA 2011-01-29 08:17:10 EST
commit fa71ed4d6b0ff99e92c80c214b886d7c5044569e
Author: Hristo Iliev <hsiliev@gmail.com>
Date:   Sat Jan 29 14:54:13 2011 +0200

    bug 328566: Negotiation timeout is now configurable to reduce the tests execution from 120 to around 4 seconds

commit a22928da380e04d4c65e67f18343dc4555897c52
Author: Hristo Iliev <hsiliev@gmail.com>
Date:   Sat Jan 29 11:18:35 2011 +0200

    bug 328566: changed the tests wait time from 10 to 2 seconds

commit dca28ed19a957c7ebbcfacc5648817d212dceb32
Author: Lazar Kirchev <l.kirchev@sap.com>
Date:   Thu Jan 27 16:48:41 2011 +0200

    bug 328566: enhanced telnet support over the equinox console
Comment 16 Hristo Iliev CLA 2011-01-29 14:10:28 EST
commit f04288690654806efab8a6fa5f62363bbc5984fc
Author: Hristo Iliev <hsiliev@gmail.com>
Date:   Sat Jan 29 20:59:08 2011 +0200

    bug 328566: o.e.v.osgi.console bundle added in lib/kernel
Comment 17 Hristo Iliev CLA 2011-02-03 09:38:40 EST
Contribution is now in kernel and web distribution