From 1319ec464da65b02ea0e177b12e5a1e7cd7f3fd1 Mon Sep 17 00:00:00 2001 From: Anna Dushistova Date: Tue, 31 May 2011 14:07:15 +0000 Subject: [PATCH] [274153] Returned session lost handling to isActive(). --- .../ssh/terminal/SshTerminalShell.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java index 362537c7b4a..c3ef438a630 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java @@ -6,10 +6,11 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Martin Oberhuber (Wind River) - initial API and implementation - * Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE - * Martin Oberhuber (Wind River) - [227320] Fix endless loop in SshTerminalShell - * Yufen Kuo (MontaVista) - [274153] Fix pipe closed with RSE + * Martin Oberhuber (Wind River) - initial API and implementation + * Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE + * Martin Oberhuber (Wind River) - [227320] Fix endless loop in SshTerminalShell + * 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; @@ -193,7 +194,7 @@ public class SshTerminalShell extends AbstractTerminalShell { } } - public void exit() { + public void exit() { if (fChannel != null) { try { try { @@ -209,18 +210,23 @@ public class SshTerminalShell extends AbstractTerminalShell { fChannel.disconnect(); } finally { fChannel = null; - } - Session session = fSessionProvider.getSession(); - if (session != null && !session.isConnected()) { - fSessionProvider.handleSessionLost(); + isActive(); } } } - public boolean isActive() { + public boolean isActive() { if (fChannel != null && !fChannel.isEOF()) { 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; }