From 21e5739a8f89fe18eff341c11a4bfbcf4596b8ab Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Thu, 7 May 2015 09:44:51 +0200 Subject: [PATCH] Rework fix for bug 420928 We need to continue polling the text model until the terminal is actually disconnected from the input stream, otherwise error messages about connect failures don't appear in the terminal. --- .../tm/internal/terminal/emulator/VT100TerminalControl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java b/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java index 86f44659954..20c9af95d13 100644 --- a/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java +++ b/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java @@ -390,7 +390,6 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC } disconnectTerminal(); fClipboard.dispose(); - fPollingTextCanvasModel.stopPolling(); getTerminalText().dispose(); } @@ -446,6 +445,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC job.join(); } catch (InterruptedException e) {} } + fPollingTextCanvasModel.stopPolling(); } private void waitForConnect() { @@ -470,6 +470,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC if (getState() == TerminalState.CONNECTED) fFocusListener.captureKeyEvents(true); } + fPollingTextCanvasModel.startPolling(); startReaderJob(); } @@ -786,7 +787,6 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC // should never happen! e.printStackTrace(); } - } public OutputStream getRemoteToTerminalOutputStream() { @@ -1252,12 +1252,10 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC if(fCtlText!=null && !fCtlText.isDisposed()) { if (isConnected()) { fCtlText.setCursorEnabled(true); - fPollingTextCanvasModel.startPolling(); } else { fCtlText.setCursorEnabled(false); // Stop capturing all key events fFocusListener.captureKeyEvents(false); - fPollingTextCanvasModel.stopPolling(); } } }