Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem extending console(Problem with org.eclipse.cdt.utils.spawner.SpawnerOutputStream.write method)
Problem extending console [message #815625] Wed, 07 March 2012 21:55 Go to next message
Stefano Oliveri is currently offline Stefano OliveriFriend
Messages: 4
Registered: March 2012
Junior Member
Dear all,

I'm working to extend the ProcessConsole functionality of my CDT based product.

This is the use case
-----------------------------
When the user press a special key (like SWT.ARROW_DOWN, SWT.ARROW_UP and SWT.TAB) in the console view (instance of the ConsoleView linked with a ProcessConsole), I need to forward it to the underlying process that is a Unix like console with history and auto competition capabilities.

This is my solution
---------------------------
1. I listen for key event in order to prevent the StyledText to handle the special key.
2. I use the IStreamsProxy.write(String input) method of the RuntimeProcess attached to the console in order to send the character to the system process.

Problem
------------
All works fine except for the \t (TAB) character. I observed that the IStreamProxy.write method uses the org.eclipse.cdt.utils.spawner.
SpawnerOutputStream.write(byte[] b, int off, int len) one, taht is a native method. It seems that it replaces \t with \n. For example when I call IStreamsProxy.write("a\ta\ta"), the SpawnerOutputStream.write(...) is called one time for each character but my system process receive the string "a\na\na".

I will appreciate any suggestion and I hope this is the right place to post my question.

Best regards,
Stefano
Re: Problem extending console [message #815969 is a reply to message #815625] Thu, 08 March 2012 09:14 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You should better post your question to the cdt dev mailing list.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Problem extending console [message #815981 is a reply to message #815969] Thu, 08 March 2012 09:27 Go to previous message
Stefano Oliveri is currently offline Stefano OliveriFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks for your suggestion. I already posted my question on that mailing list but without success.
I will try to post again and to be more clear.

Regards,
Stefano
Previous Topic:undefined reference to strcmp
Next Topic:Changing the color of the popup widget
Goto Forum:
  


Current Time: Thu Apr 18 23:49:42 GMT 2024

Powered by FUDForum. Page generated in 0.02172 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top