Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369685 - Current linebreaks from help message of the CDOCommandProvider doesn't work under windows
Summary: Current linebreaks from help message of the CDOCommandProvider doesn't work u...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows All
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 10:52 EST by Heiko Techteam CLA
Modified: 2012-09-21 06:52 EDT (History)
2 users (show)

See Also:


Attachments
Git Patch of org.eclipse.emf.cdo.server (12.10 KB, patch)
2012-01-25 10:52 EST, Heiko Techteam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Techteam CLA 2012-01-25 10:52:03 EST
Created attachment 210059 [details]
Git Patch of org.eclipse.emf.cdo.server

Currently in the help message is "\n" used as a line break.
In Windows (telnet, putty), these line breaks are not executed cleanly and as a
result you get a wild-shifted display of the commands.

This is where the line breaks expand to "\r\n".

I hope my first attempt with Git patch is useable.

Greetings
Heiko
Comment 1 Eike Stepper CLA 2012-04-08 06:42:12 EDT
How excatly can I reproduce your problem? I'm also working on Windows but the Eclipse console doesn't seem to have any issues with the line breaks as they are.

I'm reluctant to make line breaks specific to any kind of OS. Wouldn't that mean that soon other users would complain it doesn't work on, e.g., Linux anymore?

In general, how can a server provide a client with the needed line breaks without knowing what OS this client is running on? All this makes me think you've just not found the proper line ending conversion settins in your console client.
Comment 2 Heiko Techteam CLA 2012-04-16 07:26:57 EDT
To reproduce the problem(I've the problem at a windows system):
Use as example the CDO Server launch, an add a port for the -console parameter.
Connect to the console with putty or windows telnet (with the default properties).
On both you will see the OSGi - help informations are formated clean, the CDO and Net4j  help are not.
In putty you can change the property: Terminal -> Implicit CR in every LF , than you get also a clean formated output.

 
For this bug I've looked into the code from the 
org.eclipse.core.internal.registry.osgi.RegistryCommandProvider from 
org.eclipse.equinox.registry.osgi bundle.

This and also all other "default available CommandProviders" from the reference hierarchy of CommandProvider uses the "\r\n" as line break.
So I think that the "\r\n"-linebreak will work also under linux systems.
Comment 3 Eike Stepper CLA 2012-04-17 02:01:12 EDT
If the Net4j and CDO contributions to the console really behave differently from the othzers then we should certainly fix this. Thanks for pushing on this ;-)
Comment 4 Eike Stepper CLA 2012-04-18 12:25:33 EDT
commit 8ecec02da7f74d57b0e7425adfb854e75bc6c221
Comment 5 Eike Stepper CLA 2012-04-18 12:26:36 EDT
Port to 4.1 via bug 377108.
Comment 6 Eike Stepper CLA 2012-09-21 06:52:02 EDT
Closing.