diff --git a/terminus-terminal/src/components/terminalTab.component.ts b/terminus-terminal/src/components/terminalTab.component.ts index eedf405050813cb95c378a6e6df4cbdf6e39fe00..be7051e40e1afb9065f3210a408746a22a3b5ba1 100644 --- a/terminus-terminal/src/components/terminalTab.component.ts +++ b/terminus-terminal/src/components/terminalTab.component.ts @@ -292,6 +292,7 @@ export class TerminalTabComponent extends BaseTabComponent { sendInput (data: string) { this.session.write(data) + this.frontend.scrollToBottom() } write (data: string) { diff --git a/terminus-terminal/src/frontends/frontend.ts b/terminus-terminal/src/frontends/frontend.ts index 253a9d3c8e031570e475beb6af63d0fb12ee8418..4e0550c5f0ff54847f3d66b4eaf725b49c629227 100644 --- a/terminus-terminal/src/frontends/frontend.ts +++ b/terminus-terminal/src/frontends/frontend.ts @@ -52,6 +52,7 @@ export abstract class Frontend { abstract write (data: string): void abstract clear (): void abstract visualBell (): void + abstract scrollToBottom (): void abstract configure (configStore: any): void abstract setZoom (zoom: number): void diff --git a/terminus-terminal/src/frontends/htermFrontend.ts b/terminus-terminal/src/frontends/htermFrontend.ts index 5023cae2608f781976f45f5d38ff94b536db0352..829f807e34fb514ca1ce97b169592e9717212672 100644 --- a/terminus-terminal/src/frontends/htermFrontend.ts +++ b/terminus-terminal/src/frontends/htermFrontend.ts @@ -141,6 +141,10 @@ export class HTermFrontend extends Frontend { }, 125) } + scrollToBottom (): void { + this.term.scrollEnd() + } + private setFontSize () { preferenceManager.set('font-size', this.configuredFontSize * Math.pow(1.1, this.zoom)) } diff --git a/terminus-terminal/src/frontends/xtermFrontend.ts b/terminus-terminal/src/frontends/xtermFrontend.ts index 6f6cf1296d06c6407d267cd1fe66d8cceace13fb..f05cfac6a886d5874f13fbebed8f36faea86ece2 100644 --- a/terminus-terminal/src/frontends/xtermFrontend.ts +++ b/terminus-terminal/src/frontends/xtermFrontend.ts @@ -77,6 +77,10 @@ export class XTermFrontend extends Frontend { (this.xterm as any).bell() } + scrollToBottom (): void { + this.xterm.scrollToBottom() + } + configure (config: any): void { this.xterm.setOption('fontFamily', `"${config.terminal.font}", "monospace-fallback", monospace`) this.xterm.setOption('bellStyle', config.terminal.bell)