mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 03:15:33 +02:00
[170814] avoid excessive sending of resize packets
This commit is contained in:
parent
8f52495e85
commit
9e62becd1e
6 changed files with 24 additions and 9 deletions
|
@ -3,7 +3,7 @@
|
|||
id="org.eclipse.tm.terminal"
|
||||
label="%featureName"
|
||||
provider-name="%providerName"
|
||||
version="0.9.1.qualifier">
|
||||
version="0.9.2.qualifier">
|
||||
|
||||
<description>
|
||||
%description
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
id="org.eclipse.tm.terminal.ssh"
|
||||
label="%featureName"
|
||||
provider-name="%providerName"
|
||||
version="0.9.0.qualifier">
|
||||
version="0.9.1.qualifier">
|
||||
|
||||
<description>
|
||||
%description
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.ssh;singleton:=true
|
||||
Bundle-Version: 0.9.0.qualifier
|
||||
Bundle-Version: 0.9.1.qualifier
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -32,6 +32,8 @@ public class SshConnector implements ITerminalConnector {
|
|||
private ChannelShell fChannel;
|
||||
private SshConnection fConnection;
|
||||
private final SshSettings fSettings;
|
||||
private int fWidth;
|
||||
private int fHeight;
|
||||
public SshConnector() {
|
||||
this(new SshSettings());
|
||||
try {
|
||||
|
@ -80,9 +82,12 @@ public class SshConnector implements ITerminalConnector {
|
|||
return false;
|
||||
}
|
||||
public void setTerminalSize(int newWidth, int newHeight) {
|
||||
if(fChannel!=null)
|
||||
fChannel.setPtySize(newWidth, newHeight, 8, 8);
|
||||
|
||||
if(fChannel!=null && (newWidth!=fWidth || newHeight!=fHeight)) {
|
||||
//avoid excessive communications due to change size requests by caching previous size
|
||||
fChannel.setPtySize(newWidth, newHeight, 8*newWidth, 8*newHeight);
|
||||
fWidth=newWidth;
|
||||
fHeight=newHeight;
|
||||
}
|
||||
}
|
||||
public InputStream getInputStream() {
|
||||
return fInputStream;
|
||||
|
@ -128,5 +133,7 @@ public class SshConnector implements ITerminalConnector {
|
|||
}
|
||||
void setChannel(ChannelShell channel) {
|
||||
fChannel = channel;
|
||||
fWidth=-1;
|
||||
fHeight=-1;
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
|
||||
Bundle-Version: 0.9.1.qualifier
|
||||
Bundle-Version: 0.9.2.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.terminal.internal.control.TerminalPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -35,6 +35,9 @@ public class TelnetConnector implements ITerminalConnector {
|
|||
private ITerminalControl fControl;
|
||||
private TelnetConnection fTelnetConnection;
|
||||
private final TelnetSettings fSettings;
|
||||
private int fWidth = -1;
|
||||
private int fHeight = -1;
|
||||
|
||||
public TelnetConnector() {
|
||||
this(new TelnetSettings());
|
||||
}
|
||||
|
@ -47,6 +50,8 @@ public class TelnetConnector implements ITerminalConnector {
|
|||
public void connect(ITerminalControl control) {
|
||||
Logger.log("entered."); //$NON-NLS-1$
|
||||
fControl=control;
|
||||
fWidth=-1;
|
||||
fHeight=-1;
|
||||
TelnetConnectWorker worker = new TelnetConnectWorker(this,control);
|
||||
worker.start();
|
||||
}
|
||||
|
@ -85,9 +90,12 @@ public class TelnetConnector implements ITerminalConnector {
|
|||
return fTelnetConnection.localEcho();
|
||||
}
|
||||
public void setTerminalSize(int newWidth, int newHeight) {
|
||||
if(fTelnetConnection!=null)
|
||||
if(fTelnetConnection!=null && (newWidth!=fWidth || newHeight!=fHeight)) {
|
||||
//avoid excessive communications due to change size requests by caching previous size
|
||||
fTelnetConnection.setTerminalSize(newWidth, newHeight);
|
||||
|
||||
fWidth=newWidth;
|
||||
fHeight=newHeight;
|
||||
}
|
||||
}
|
||||
public InputStream getInputStream() {
|
||||
return fInputStream;
|
||||
|
|
Loading…
Add table
Reference in a new issue