mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 07:35:24 +02:00
[197848] Fix shell terminated state when remote dies
This commit is contained in:
parent
4911ba3872
commit
f1764e6689
2 changed files with 21 additions and 7 deletions
|
@ -12,7 +12,7 @@
|
|||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* Martin Oberhuber (Wind River) - [197848] Fix shell terminated state when remote dies
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.services.shells;
|
||||
|
@ -132,7 +132,6 @@ public abstract class AbstractHostShellOutputReader extends Thread implements I
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void fireOutputChanged(IHostShellChangeEvent event)
|
||||
{
|
||||
for (int i = 0; i < _listeners.size(); i++)
|
||||
|
@ -158,7 +157,6 @@ public abstract class AbstractHostShellOutputReader extends Thread implements I
|
|||
{
|
||||
if (_keepRunning)
|
||||
{
|
||||
|
||||
_waitIncrement = 0;
|
||||
//dispose();
|
||||
}
|
||||
|
@ -172,15 +170,18 @@ public abstract class AbstractHostShellOutputReader extends Thread implements I
|
|||
{
|
||||
Thread.sleep(_waitIncrement);
|
||||
Thread.yield();
|
||||
handle();
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
finish();
|
||||
return;
|
||||
_keepRunning = false;
|
||||
}
|
||||
|
||||
handle();
|
||||
}
|
||||
if (!isErrorReader()) {
|
||||
//Bug 197848: Fire empty event as notification that we are done
|
||||
HostShellChangeEvent event = new HostShellChangeEvent(_hostShell, this, 0, 0);
|
||||
fireOutputChanged(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||
* Martin Oberhuber (Wind River) - [197848] Fix shell terminated state when remote dies
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.subsystems.shells.servicesubsystem;
|
||||
|
@ -24,6 +25,7 @@ import org.eclipse.rse.core.RSECorePlugin;
|
|||
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.internal.subsystems.shells.core.ShellStrings;
|
||||
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell;
|
||||
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteOutput;
|
||||
|
@ -87,6 +89,17 @@ public class OutputRefreshJob extends UIJob
|
|||
registry.fireEvent(
|
||||
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, _command.getCommandSubSystem()));
|
||||
}
|
||||
|
||||
//Bug 197848: Artificial event for shell termination
|
||||
if (_outputs.length == 0 && !_command.isActive()) {
|
||||
ISubSystem subsys = _command.getCommandSubSystem();
|
||||
//update action states in commands view
|
||||
registry.fireEvent(
|
||||
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED, subsys));
|
||||
//update "connected" overlay in SystemView
|
||||
registry.fireEvent(
|
||||
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_REFRESH, subsys));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Add table
Reference in a new issue