File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
main/resources/META-INF/frontend/fc-xterm
test/java/com/flowingcode/vaadin/addons/xterm/integration Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -125,19 +125,12 @@ class SelectionAddon extends TerminalAddon<ISelectionMixin> {
125125 if ( this . __selectionAnchor !== undefined ) {
126126 let buffer = ( terminal . buffer . active as any ) . _buffer ;
127127 let range = buffer . getWrappedRangeForLine ( buffer . ybase + buffer . y ) ;
128- let pos = terminal . getSelectionPosition ( ) ;
129-
130- //see https://github.com/xtermjs/xterm.js/issues/3552
131- pos . endColumn == 0 && -- pos . endRow ;
132-
128+ let pos = terminal . getSelectionPosition ( ) ;
133129 if ( pos && pos . startRow >= range . first && pos . endRow <= range . last ) {
130+ //let selectionStart = pos.startRow * terminal.cols + pos.startColumn;
134131 if ( ! this . __selectionRight ) {
135132 //cursor backward wrapped
136- if ( pos . endColumn == 0 ) {
137- terminal . write ( "\x1b[<" + ( this . __selectionLength - 1 ) + "L" ) ;
138- } else {
139- terminal . write ( "\x1b[<" + this . __selectionLength + "L" ) ;
140- }
133+ terminal . write ( "\x1b[<" + this . __selectionLength + "L" ) ;
141134 }
142135 //delete characters wrapped
143136 terminal . write ( "\x1b[<" + this . __selectionLength + "D" ) ;
Original file line number Diff line number Diff line change @@ -98,9 +98,7 @@ public void testSelectionFeature() throws InterruptedException {
9898 term .write (text );
9999 assertThat (term .currentLine (), is (text ));
100100 term .sendKeys (Keys .SHIFT , Keys .HOME );
101- // https://github.com/xtermjs/xterm.js/issues/3552
102- // Selecting a whole line using API includes trailing CRLF
103- assertThat (term .getSelection (), is (text + "\n " ));
101+ assertThat (term .getSelection (), is (text ));
104102 term .sendKeys (Keys .DELETE );
105103 assertThat (term .currentLine (), isEmptyString ());
106104
@@ -109,9 +107,10 @@ public void testSelectionFeature() throws InterruptedException {
109107 assertThat (term .currentLine (), is (text ));
110108 term .sendKeys (Keys .HOME );
111109 term .sendKeys (Keys .SHIFT , Keys .END );
112- assertThat (term .getSelection (), is (text + " \n " ));
110+ assertThat (term .getSelection (), is (text ));
113111 term .sendKeys (Keys .DELETE );
114112 assertThat (term .currentLine (), isEmptyString ());
113+
115114 }
116115
117116}
You can’t perform that action at this time.
0 commit comments