From 8801ab147b014f9b7d6d2da09969250ca9c47022 Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 6 Sep 2022 00:14:48 -0700 Subject: [PATCH] force update usedRows when terminal is resized --- src/main.tsx | 10 ++++++++-- src/sh2.less | 8 ++++++-- src/term.ts | 14 +++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 9d68bdf1..21b6ae3b 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1064,10 +1064,16 @@ class ScreenWindowView extends React.Component<{sw : ScreenWindow}, {}> { cmdNum++; } } + let isActive = sw.isActive(); return (
-
- {sw.name.get()}{sw.shouldFollow.get() ? "*" : ""} +
+ + {sw.name.get()} + +   + +
diff --git a/src/sh2.less b/src/sh2.less index a9812016..a16fe6cc 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -67,12 +67,16 @@ html, body, #main { position: absolute; top: 0; right: 0; - background-color: rgba(78, 154, 6, 0.5); - color: white; + background-color: rgba(78, 154, 6, 0.65); + color: black; padding: 2px 4px 2px 4px; border-bottom-left-radius: 5px; z-index: 10; font-size: 12px; + + &.is-active { + color: white; + } } .window-empty { diff --git a/src/term.ts b/src/term.ts index 759d5216..464a1787 100644 --- a/src/term.ts +++ b/src/term.ts @@ -136,10 +136,13 @@ class TermWrap { return usedRows; } - updateUsedRows() { + updateUsedRows(forceFull : boolean) { if (this.terminal == null) { return; } + if (forceFull) { + this.atRowMax = false; + } if (this.atRowMax) { return; } @@ -147,11 +150,11 @@ class TermWrap { if (tur >= this.terminal.rows) { this.atRowMax = true; } - if (tur <= this.usedRows.get()) { - return; - } mobx.action(() => { let oldUsedRows = this.usedRows.get(); + if (!forceFull && tur <= oldUsedRows) { + return; + } this.usedRows.set(tur); GlobalModel.setTUR(this.sessionId, this.cmdId, this.termSize, tur); if (this.connectedElem) { @@ -184,6 +187,7 @@ class TermWrap { } this.termSize = newSize; this.terminal.resize(newSize.cols, newSize.rows); + this.updateUsedRows(true); } reloadTerminal(delayMs : number) { @@ -240,7 +244,7 @@ class TermWrap { } this.ptyPos += data.length; this.terminal.write(data, () => { - this.updateUsedRows(); + this.updateUsedRows(false); }); } }