mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Terminal: Added method to control if the terminal control tries to
reconnect the terminal connection if closed and the user hits ENTER
This commit is contained in:
parent
129c125f4a
commit
10d0897a3f
10 changed files with 43 additions and 9 deletions
|
@ -13,7 +13,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal"
|
||||
label="%featureName"
|
||||
version="3.2.200.qualifier"
|
||||
version="3.2.300.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal</artifactId>
|
||||
<version>3.2.200.qualifier</version>
|
||||
<version>3.2.300.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.core.sdk"
|
||||
label="%featureName"
|
||||
version="3.3.200.qualifier"
|
||||
version="3.3.300.qualifier"
|
||||
provider-name="%providerName"
|
||||
image="eclipse_update_120.jpg">
|
||||
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.core.sdk</artifactId>
|
||||
<version>3.3.200.qualifier</version>
|
||||
<version>3.3.300.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.sdk"
|
||||
label="%featureName"
|
||||
version="3.3.200.qualifier"
|
||||
version="3.3.300.qualifier"
|
||||
provider-name="%providerName"
|
||||
image="eclipse_update_120.jpg">
|
||||
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.sdk</artifactId>
|
||||
<version>3.3.200.qualifier</version>
|
||||
<version>3.3.300.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
|
||||
Bundle-Version: 3.2.200.qualifier
|
||||
Bundle-Version: 3.2.300.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal</artifactId>
|
||||
<version>3.2.200.qualifier</version>
|
||||
<version>3.2.300.qualifier</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -128,6 +128,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
|||
private ITerminalConnector fConnector;
|
||||
private final ITerminalConnector[] fConnectors;
|
||||
private final boolean fUseCommonPrefs;
|
||||
private boolean connectOnEnterIfClosed = true;
|
||||
|
||||
PipedInputStream fInputStream;
|
||||
private static final String defaultEncoding = new java.io.InputStreamReader(new java.io.ByteArrayInputStream(new byte[0])).getEncoding();
|
||||
|
@ -868,7 +869,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
|||
char character = event.character;
|
||||
|
||||
//if (!isConnected()) {
|
||||
if (fState==TerminalState.CLOSED) {
|
||||
if (fState==TerminalState.CLOSED && isConnectOnEnterIfClosed()) {
|
||||
// Pressing ENTER while not connected causes us to connect.
|
||||
if (character == '\r') {
|
||||
connectTerminal();
|
||||
|
@ -1157,4 +1158,20 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
|||
public void setInvertedColors(boolean invert) {
|
||||
fCtlText.setInvertedColors(invert);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#setConnectOnEnterIfClosed(boolean)
|
||||
*/
|
||||
public final void setConnectOnEnterIfClosed(boolean on) {
|
||||
connectOnEnterIfClosed = on;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl#isConnectOnEnterIfClosed()
|
||||
*/
|
||||
public final boolean isConnectOnEnterIfClosed() {
|
||||
return connectOnEnterIfClosed;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -123,4 +123,21 @@ public interface ITerminalControl {
|
|||
*/
|
||||
void setMsg(String msg);
|
||||
|
||||
/**
|
||||
* Sets if or if not the terminal view control should try to reconnect
|
||||
* the terminal connection if the user hits ENTER in a closed terminal.
|
||||
* <p>
|
||||
* Reconnect on ENTER if terminal is closed is enabled by default.
|
||||
*
|
||||
* @param on <code>True</code> to enable the reconnect, <code>false</code> to disable it.
|
||||
*/
|
||||
void setConnectOnEnterIfClosed(boolean on);
|
||||
|
||||
/**
|
||||
* Returns if or if not the terminal view control should try to reconnect
|
||||
* the terminal connection if the user hits ENTER in a closed terminal.
|
||||
*
|
||||
* @return <code>True</code> the reconnect is enabled, <code>false</code> if disabled.
|
||||
*/
|
||||
boolean isConnectOnEnterIfClosed();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue