1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 04:55:22 +02:00

[249715] [dstore][shells] Unix shell does not echo command

This commit is contained in:
David McKnight 2008-12-04 17:57:33 +00:00
parent 8550cff10e
commit 91d6e55fa1
2 changed files with 11 additions and 49 deletions

View file

@ -614,10 +614,6 @@ public class CommandMinerThread extends MinerThread
writer.newLine();
writer.flush();
// for bug 249715 - keeping track of time of last input
// in order know when to stop waiting for output
_stdOutputHandler.setTimeOfLastInput(System.currentTimeMillis());
if (!_isWindows && (input.startsWith("cd ") || input.equals("cd"))) //$NON-NLS-1$ //$NON-NLS-2$
{
queryCWD();
@ -628,24 +624,10 @@ public class CommandMinerThread extends MinerThread
}
if (!_isWindows && !_isTTY)
{
// special case for pattern interpretting
// if cwd is not set, then files aren't resolved
// create mock prompt to ensure that they do get resolved
if (input.startsWith("cd ") || input.equals("cd")) //$NON-NLS-1$ //$NON-NLS-2$
{
writer.write("echo $PWD'>'"); //$NON-NLS-1$
writer.newLine();
writer.flush();
// sleep to allow reader to interpret before going on
try
{
Thread.sleep(100);
}
catch (InterruptedException e)
{
}
}
// always prompt after the command
writer.write("echo $PWD'>'"); //$NON-NLS-1$
writer.newLine();
writer.flush();
}
}
catch (IOException e)

View file

@ -55,8 +55,6 @@ public class OutputHandler extends Handler {
private List _encodings;
// for bug 249715
private long _timeOfLastInput = 0;
public OutputHandler(DataInputStream reader, String qualifier,
boolean isTerminal, boolean isStdError, boolean isShell,
@ -87,9 +85,6 @@ public class OutputHandler extends Handler {
}
public void setTimeOfLastInput(long time){
_timeOfLastInput = time;
}
public void handle() {
@ -170,26 +165,11 @@ public class OutputHandler extends Handler {
// re-determine available if none available now
if (available == 0) {
if (!_isStdError && !_isTerminal){
long lastInput = _timeOfLastInput;
while (lastInput == _timeOfLastInput && _keepRunning && available == 0){ // once there's something new, we can stop waiting
Thread.sleep(500); // wait in case there is something
available = checkAvailable();
}
if (available == 0){
// it's possible that there is no output for something
// in the non-TTY case we need to prompt
return new String[0];
}
}
else {
lookahead = _reader.read();
if (lookahead == -1) {
return null;
} else {
available = _reader.available() + 1;
}
lookahead = _reader.read();
if (lookahead == -1) {
return null;
} else {
available = _reader.available() + 1;
}
}