[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cdt-dev] Problem with org.eclipse.cdt.utils.spawner.SpawnerOutputStream.write method
- From: Stefano Oliveri <stefano.oliveri@xxxxxxxxx>
- Date: Fri, 2 Mar 2012 11:38:34 +0100
- Authentication-results: mr.google.com; spf=pass (google.com: domain of firstname.lastname@example.org designates 10.60.26.166 as permitted sender) email@example.com
- Delivered-to: firstname.lastname@example.org
I'm working to extend the ProcessConsole functionality of my CDT based product.
This is the use case
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.
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.
All works fine except for the \t (TAB)
character. I observed that the IStreamProxy.write method uses the
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.