[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.dltk] Re: capturing output of remote run process

Hi Abhijit,
Hi Andrei,

Thanks a lot for your responce. Now we are getting the output of remote project in our console.
But now the output comes as command prompt (of unix) followed by required output.
On going through the code we have observed that in the method MyHostShellProcessAdapter.shellOutputChanged() we have the following code:


if (trimLine.endsWith(this.pattern1)) {
if (!trimLine.equals(this.pattern1)) {
// We need to output part of line
int pos = line.indexOf(this.pattern1);
outputStream.write(line.substring(0, pos).getBytes());
outputStream.write('\n');
outputStream.flush();
}
}
In the second if condition the line from 0 to pos is written to outputstream. Hence the command prompt appears in output, which we don't require. We want the output between the patterns only to be displayed.
Can we have the second if condition removed in the next release?
Let's me explain why second if condition are required:

Lets use following script output:
%PATTERN%
Output line1
Output line2
Output line3%PATTERN%

There is no new line on end of output. Also this is happen then we have only one line with out new line symbol at end. Without second if, we will receive no output.

Possibly solution for your case:
I suppose you could overwrite your command prompt passing environment variables PS1,PS2,PS4

With following values all output are fine:
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
PS2='> '
PS4='+ '

Also I suppose we could pass some default prompt from out code.
Thoughts?

Best regards,
Andrei Sobolev.