1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-18 22:45:23 +02:00

[274153] Returned session lost handling to isActive().

This commit is contained in:
Anna Dushistova 2011-05-31 14:07:15 +00:00
parent bf8c8a83db
commit 1319ec464d

View file

@ -6,10 +6,11 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - initial API and implementation * Martin Oberhuber (Wind River) - initial API and implementation
* Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE * Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE
* Martin Oberhuber (Wind River) - [227320] Fix endless loop in SshTerminalShell * Martin Oberhuber (Wind River) - [227320] Fix endless loop in SshTerminalShell
* Yufen Kuo (MontaVista) - [274153] Fix pipe closed with RSE * Yufen Kuo (MontaVista) - [274153] Fix pipe closed with RSE
* Anna Dushistova (Mentor Graphics) - Returned "session lost" handling to isActive()
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.services.ssh.terminal; package org.eclipse.rse.internal.services.ssh.terminal;
@ -193,7 +194,7 @@ public class SshTerminalShell extends AbstractTerminalShell {
} }
} }
public void exit() { public void exit() {
if (fChannel != null) { if (fChannel != null) {
try { try {
try { try {
@ -209,18 +210,23 @@ public class SshTerminalShell extends AbstractTerminalShell {
fChannel.disconnect(); fChannel.disconnect();
} finally { } finally {
fChannel = null; fChannel = null;
} isActive();
Session session = fSessionProvider.getSession();
if (session != null && !session.isConnected()) {
fSessionProvider.handleSessionLost();
} }
} }
} }
public boolean isActive() { public boolean isActive() {
if (fChannel != null && !fChannel.isEOF()) { if (fChannel != null && !fChannel.isEOF()) {
return true; return true;
} }
// shell is not active: check for session lost
//AD: comment out exit call until we find better solution,
//see https://bugs.eclipse.org/bugs/show_bug.cgi?id=274153
//exit();
Session session = fSessionProvider.getSession();
if (session != null && !session.isConnected()) {
fSessionProvider.handleSessionLost();
}
return false; return false;
} }