-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Removing XTerm component from the parent container then adding it back will result in a blank uninitialized terminal: there is no scrollback history, and the settings (such as cursor style or similar) are not preserved.
The code which reproduces the issue:
public class MainView extends VerticalLayout {
public MainView() {
final XTerm xterm = new XTerm();
add(xterm);
xterm.setWidthFull();
xterm.setHeight("500px");
xterm.writeln("Hello!");
xterm.setCursorStyle(ITerminalOptions.CursorStyle.UNDERLINE);
xterm.setCursorBlink(true);
xterm.write("$ ");
xterm.addLineListener(e -> {
System.out.println(e.getLine());
xterm.writeln("You typed: " + e.getLine());
xterm.write("$ ");
});
final Checkbox checkbox = new Checkbox("Add/remove xterm");
checkbox.setValue(true);
add(checkbox);
checkbox.addValueChangeListener(e -> {
if (e.getValue()) {
MainView.this.add(xterm);
} else {
MainView.this.remove(xterm);
}
});
add(checkbox);
}
}Steps to reproduce:
- Type in something
- Uncheck the checkbox
- Check the checkbox back
- Observe that the xterm settings are not preserved.
Just a wild suggestion: perhaps the settings and the scrollback buffer could actually be preserved on the Java side and applied every time the component is attached.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Done