Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Problem with org.eclipse.cdt.utils.spawner.SpawnerOutputStream.write method

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

Back to the top