1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 11:25:35 +02:00

[170814] avoid excessive sending of resize packets

This commit is contained in:
Martin Oberhuber 2007-01-17 18:51:18 +00:00
parent 8f52495e85
commit 9e62becd1e
6 changed files with 24 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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,

View file

@ -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;
}
}

View file

@ -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

View file

@ -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;