mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-27 10:55:33 +02:00
Bug 206329 - [terminal][regression] Changing terminal size right after connect does not scroll properly
This commit is contained in:
parent
164552f40e
commit
c1e935b1b9
5 changed files with 20 additions and 26 deletions
|
@ -13,7 +13,7 @@
|
||||||
<feature
|
<feature
|
||||||
id="org.eclipse.tm.terminal"
|
id="org.eclipse.tm.terminal"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="3.1.0.qualifier"
|
version="3.1.1.qualifier"
|
||||||
provider-name="%providerName">
|
provider-name="%providerName">
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<feature
|
<feature
|
||||||
id="org.eclipse.tm.terminal.local.sdk"
|
id="org.eclipse.tm.terminal.local.sdk"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="0.2.0.qualifier"
|
version="0.2.1.qualifier"
|
||||||
provider-name="%providerName"
|
provider-name="%providerName"
|
||||||
image="eclipse_update_120.jpg">
|
image="eclipse_update_120.jpg">
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<feature
|
<feature
|
||||||
id="org.eclipse.tm.terminal.sdk"
|
id="org.eclipse.tm.terminal.sdk"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="3.2.0.qualifier"
|
version="3.2.1.qualifier"
|
||||||
provider-name="%providerName"
|
provider-name="%providerName"
|
||||||
image="eclipse_update_120.jpg">
|
image="eclipse_update_120.jpg">
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
|
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
|
||||||
Bundle-Version: 3.1.0.qualifier
|
Bundle-Version: 3.1.1.qualifier
|
||||||
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
|
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* Michael Scharf (Wind River) - initial API and implementation
|
||||||
|
* Anton Leherbauer (Wind River) - [206329] Changing terminal size right after connect does not scroll properly
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.emulator;
|
package org.eclipse.tm.internal.terminal.emulator;
|
||||||
|
|
||||||
|
@ -77,34 +78,27 @@ public class VT100EmulatorBackend implements IVT100EmulatorBackend {
|
||||||
synchronized (fTerminal) {
|
synchronized (fTerminal) {
|
||||||
if(lines==fLines && cols==fColumns)
|
if(lines==fLines && cols==fColumns)
|
||||||
return; // nothing to do
|
return; // nothing to do
|
||||||
// cursor line from the bottom
|
// relative cursor line
|
||||||
int cl=lines-(fLines-getCursorLine());
|
int cl=getCursorLine();
|
||||||
int cc=getCursorColumn();
|
int cc=getCursorColumn();
|
||||||
int newLines=Math.max(lines,fTerminal.getHeight());
|
int height=fTerminal.getHeight();
|
||||||
|
// absolute cursor line
|
||||||
|
int acl=cl+height-fLines;
|
||||||
|
int newLines=Math.max(lines,height);
|
||||||
|
if(lines<fLines) {
|
||||||
|
if(height==fLines) {
|
||||||
// if the terminal has no history, then resize by
|
// if the terminal has no history, then resize by
|
||||||
// setting the size to the new size
|
// setting the size to the new size
|
||||||
if(fTerminal.getHeight()==fLines) {
|
// TODO We are assuming that cursor line points at end of text
|
||||||
if(lines<fLines) {
|
newLines=Math.max(lines, cl+1);
|
||||||
cl+=fLines-lines;
|
|
||||||
newLines=lines;
|
|
||||||
// shrink by cutting empty lines at the bottom
|
|
||||||
// int firstNoneEmptyLine;
|
|
||||||
// for (firstNoneEmptyLine = fTerminal.getHeight(); firstNoneEmptyLine <= 0; firstNoneEmptyLine--) {
|
|
||||||
// LineSegment[] segments = fTerminal.getLineSegments(firstNoneEmptyLine, 0, fTerminal.getWidth());
|
|
||||||
// if(segments.length>1)
|
|
||||||
// break;
|
|
||||||
// // is the line empty?
|
|
||||||
// if(segments[0].getText().replaceAll("[\000 ]+", "").length()==0)
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
} else {
|
|
||||||
cl+=fLines-lines;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fLines=lines;
|
fLines=lines;
|
||||||
fColumns=cols;
|
fColumns=cols;
|
||||||
// make the terminal at least as high as we need lines
|
// make the terminal at least as high as we need lines
|
||||||
fTerminal.setDimensions(newLines, fColumns);
|
fTerminal.setDimensions(newLines, fColumns);
|
||||||
|
// compute relative cursor line
|
||||||
|
cl=acl-(newLines-fLines);
|
||||||
setCursor(cl, cc);
|
setCursor(cl, cc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue