Set hasPty property for PTY based processes (PY-19573)

This flag determines whether the output is read in blocking or non-blocking mode. Non-blocking mode doesn't work for PTY based processes as they don't proper implement available() method.
This commit is contained in:
Dmitry Trofimov
2016-06-28 14:42:15 +02:00
parent 75910f448f
commit 8cd5ca7a39
@@ -25,6 +25,8 @@ import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.encoding.EncodingManager;
import com.intellij.util.io.BaseOutputReader;
import com.pty4j.unix.UnixPtyProcess;
import com.pty4j.windows.WinPtyProcess;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -68,6 +70,7 @@ public class OSProcessHandler extends BaseOSProcessHandler {
*/
public OSProcessHandler(@NotNull Process process, /*@NotNull*/ String commandLine, @Nullable Charset charset) {
super(process, commandLine, charset);
setHasPty(process instanceof UnixPtyProcess || process instanceof WinPtyProcess);
}
@NotNull