1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 21:35:40 +02:00

Target Explorer: A process redirected to a terminal cannot be reconnected once the process terminated

This commit is contained in:
Uwe Stieber 2015-03-04 09:58:35 +01:00
parent ef371f478b
commit ad9890ef85
3 changed files with 6 additions and 5 deletions

View file

@ -105,8 +105,6 @@ public interface ITerminalsConnectorConstants {
/** /**
* Property: Data flag to tell the terminal to not reconnect when hitting enter * Property: Data flag to tell the terminal to not reconnect when hitting enter
* in a disconnected terminal. * in a disconnected terminal.
* The flag can be set by adding an IPropertiesContainer with the set
* flag as PROP_DATA.
* <p> * <p>
* Property Type: {@link Boolean} * Property Type: {@link Boolean}
*/ */

View file

@ -302,6 +302,9 @@ public class TerminalService implements ITerminalService {
if (properties.get(ITerminalsConnectorConstants.PROP_FORCE_NEW) instanceof Boolean) { if (properties.get(ITerminalsConnectorConstants.PROP_FORCE_NEW) instanceof Boolean) {
flags.put(ITerminalsConnectorConstants.PROP_FORCE_NEW, (Boolean)properties.get(ITerminalsConnectorConstants.PROP_FORCE_NEW)); 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 // Open the new console
CTabItem item; CTabItem item;
if (secondaryId != null) if (secondaryId != null)

View file

@ -237,7 +237,7 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
* *
* @return The created tab item or <code>null</code> if failed. * @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) { public CTabItem createTabItem(String title, String encoding, ITerminalConnector connector, Object data, Map<String, Boolean> flags) {
Assert.isNotNull(title); Assert.isNotNull(title);
Assert.isNotNull(connector); Assert.isNotNull(connector);
@ -272,8 +272,8 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
// Create the terminal control // Create the terminal control
ITerminalViewControl terminal = TerminalViewControlFactory.makeControl(doCreateTerminalTabTerminalListener(this, item), composite, new ITerminalConnector[] { connector }, true); ITerminalViewControl terminal = TerminalViewControlFactory.makeControl(doCreateTerminalTabTerminalListener(this, item), composite, new ITerminalConnector[] { connector }, true);
if (terminal instanceof ITerminalControl && data instanceof Map<?,?>) { if (terminal instanceof ITerminalControl && flags.containsKey(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT)) {
Object value = ((Map<String, Object>)data).get(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT); Object value = flags.get(ITerminalsConnectorConstants.PROP_DATA_NO_RECONNECT);
boolean noReconnect = value instanceof Boolean ? ((Boolean)value).booleanValue() : false; boolean noReconnect = value instanceof Boolean ? ((Boolean)value).booleanValue() : false;
((ITerminalControl)terminal).setConnectOnEnterIfClosed(!noReconnect); ((ITerminalControl)terminal).setConnectOnEnterIfClosed(!noReconnect);
} }