Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2015-03-04 03:58:35 -0500
committerUwe Stieber2015-03-04 03:58:35 -0500
commitea1ae40a91db235046ac85651f5d71ab7c07d90e (patch)
tree33d36cc2d2af1023c859bf5f6ba3a325bc528822
parente3e4540138fd310b8cfecfc48ae7e7df21cb25d3 (diff)
downloadorg.eclipse.tcf-ea1ae40a91db235046ac85651f5d71ab7c07d90e.tar.gz
org.eclipse.tcf-ea1ae40a91db235046ac85651f5d71ab7c07d90e.tar.xz
org.eclipse.tcf-ea1ae40a91db235046ac85651f5d71ab7c07d90e.zip
Target Explorer: A process redirected to a terminal cannot be reconnected once the process terminated
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java7
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.core.terminals/src/org/eclipse/tcf/te/core/terminals/interfaces/constants/ITerminalsConnectorConstants.java2
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/services/TerminalService.java3
-rw-r--r--terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java6
4 files changed, 13 insertions, 5 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
index cb7df55f9..a801ae356 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
@@ -605,6 +605,13 @@ public class ProcessLauncher extends PlatformObject implements IProcessLauncher
props.put(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR, properties.getStringProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR));
props.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, Boolean.valueOf(properties.getBooleanProperty(ITerminalsConnectorConstants.PROP_FORCE_NEW)));
+ // By default, a launched process cannot be reconnected once terminated.
+ boolean noReconnect = true;
+ if (properties.containsKey(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT)) {
+ noReconnect = properties.getBooleanProperty(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT);
+ }
+ props.put(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT, Boolean.valueOf(noReconnect));
+
// The custom data object is the process launcher itself
props.put(ITerminalsConnectorConstants.PROP_DATA, this);
diff --git a/terminals/plugins/org.eclipse.tcf.te.core.terminals/src/org/eclipse/tcf/te/core/terminals/interfaces/constants/ITerminalsConnectorConstants.java b/terminals/plugins/org.eclipse.tcf.te.core.terminals/src/org/eclipse/tcf/te/core/terminals/interfaces/constants/ITerminalsConnectorConstants.java
index d7ad34531..fe7b65295 100644
--- a/terminals/plugins/org.eclipse.tcf.te.core.terminals/src/org/eclipse/tcf/te/core/terminals/interfaces/constants/ITerminalsConnectorConstants.java
+++ b/terminals/plugins/org.eclipse.tcf.te.core.terminals/src/org/eclipse/tcf/te/core/terminals/interfaces/constants/ITerminalsConnectorConstants.java
@@ -105,8 +105,6 @@ public interface ITerminalsConnectorConstants {
/**
* Property: Data flag to tell the terminal to not reconnect when hitting enter
* in a disconnected terminal.
- * The flag can be set by adding an IPropertiesContainer with the set
- * flag as PROP_DATA.
* <p>
* Property Type: {@link Boolean}
*/
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/services/TerminalService.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/services/TerminalService.java
index c7857ca24..e06206e2a 100644
--- a/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/services/TerminalService.java
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/services/TerminalService.java
@@ -302,6 +302,9 @@ public class TerminalService implements ITerminalService {
if (properties.get(ITerminalsConnectorConstants.PROP_FORCE_NEW) instanceof Boolean) {
flags.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, (Boolean)properties.get(ITerminalsConnectorConstants.PROP_FORCE_NEW));
}
+ if (properties.get(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT) instanceof Boolean) {
+ flags.put(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT, (Boolean)properties.get(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT));
+ }
// Open the new console
CTabItem item;
if (secondaryId != null)
diff --git a/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java b/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java
index ab04d4d87..41e53b33a 100644
--- a/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java
+++ b/terminals/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java
@@ -237,7 +237,7 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
*
* @return The created tab item or <code>null</code> if failed.
*/
- @SuppressWarnings({ "unused", "unchecked" })
+ @SuppressWarnings("unused")
public CTabItem createTabItem(String title, String encoding, ITerminalConnector connector, Object data, Map<String, Boolean> flags) {
Assert.isNotNull(title);
Assert.isNotNull(connector);
@@ -272,8 +272,8 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
// Create the terminal control
ITerminalViewControl terminal = TerminalViewControlFactory.makeControl(doCreateTerminalTabTerminalListener(this, item), composite, new ITerminalConnector[] { connector }, true);
- if (terminal instanceof ITerminalControl && data instanceof Map<?,?>) {
- Object value = ((Map<String, Object>)data).get(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT);
+ if (terminal instanceof ITerminalControl && flags.containsKey(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT)) {
+ Object value = flags.get(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT);
boolean noReconnect = value instanceof Boolean ? ((Boolean)value).booleanValue() : false;
((ITerminalControl)terminal).setConnectOnEnterIfClosed(!noReconnect);
}

Back to the top