remove writeln from core

This commit is contained in:
Jörg Breitbart
2019-09-13 13:06:54 +02:00
parent 50e552262a
commit dcbc7e1014
4 changed files with 8 additions and 17 deletions
+6 -6
View File
@@ -254,7 +254,7 @@ describe('Terminal', () => {
let startYDisp: number;
beforeEach(() => {
for (let i = 0; i < INIT_ROWS * 2; i++) {
term.writeln('test');
term.write('test\r\n');
}
startYDisp = INIT_ROWS + 1;
});
@@ -289,7 +289,7 @@ describe('Terminal', () => {
let startYDisp: number;
beforeEach(() => {
for (let i = 0; i < term.rows * 3; i++) {
term.writeln('test');
term.write('test\r\n');
}
startYDisp = (term.rows * 2) + 1;
});
@@ -312,7 +312,7 @@ describe('Terminal', () => {
describe('scrollToTop', () => {
beforeEach(() => {
for (let i = 0; i < term.rows * 3; i++) {
term.writeln('test');
term.write('test\r\n');
}
});
it('should scroll to the top', () => {
@@ -326,7 +326,7 @@ describe('Terminal', () => {
let startYDisp: number;
beforeEach(() => {
for (let i = 0; i < term.rows * 3; i++) {
term.writeln('test');
term.write('test\r\n');
}
startYDisp = (term.rows * 2) + 1;
});
@@ -347,7 +347,7 @@ describe('Terminal', () => {
let startYDisp: number;
beforeEach(() => {
for (let i = 0; i < term.rows * 3; i++) {
term.writeln('test');
term.write('test\r\n');
}
startYDisp = (term.rows * 2) + 1;
});
@@ -392,7 +392,7 @@ describe('Terminal', () => {
it('should not scroll down, when a custom keydown handler prevents the event', () => {
// Add some output to the terminal
for (let i = 0; i < term.rows * 3; i++) {
term.writeln('test');
term.write('test\r\n');
}
const startYDisp = (term.rows * 2) + 1;
term.attachCustomKeyEventHandler(() => {
-9
View File
@@ -1191,15 +1191,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
}
}
/**
* Writes text to the terminal, followed by a break line character (\n).
* @param data The text to write to the terminal.
*/
public writeln(data: string | Uint8Array, callback?: () => void): void {
this.write(data);
this.write('\r\n', callback);
}
public paste(data: string): void {
paste(data, this.textarea, this.bracketedPasteMode, this._coreService);
}
-1
View File
@@ -216,7 +216,6 @@ export interface IPublicTerminal extends IDisposable {
scrollToLine(line: number): void;
clear(): void;
write(data: string | Uint8Array, callback?: () => void): void;
writeln(data: string | Uint8Array, callback?: () => void): void;
paste(data: string): void;
refresh(start: number, end: number): void;
reset(): void;
+2 -1
View File
@@ -132,7 +132,8 @@ export class Terminal implements ITerminalApi {
this._core.write(data, callback);
}
public writeln(data: string | Uint8Array, callback?: () => void): void {
this._core.writeln(data, callback);
this._core.write(data);
this._core.write('\r\n', callback);
}
public paste(data: string): void {
this._core.paste(data);