get input working, fix currentrowheight constant

This commit is contained in:
sawka
2022-07-13 01:03:17 -07:00
parent f4b3f94b13
commit 05af5a8510
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType}, {}>
return <div className="line line-invalid">[cmd not found '{line.cmdid}']</div>;
}
let termLoaded = this.termLoaded.get();
let cellHeightPx = 17;
let cellHeightPx = 16;
let usedRows = cmd.getUsedRows(sw.screenId, sw.windowId);
let totalHeight = cellHeightPx * usedRows;
let remote = model.getRemote(cmd.remoteId);
+1 -1
View File
@@ -55,7 +55,7 @@ class Cmd {
console.log("term-wrap already exists for", screenId, windowId);
return;
}
termWrap = new TermWrap(elem, this.sessionId, this.cmdId, 0, this.getTermOpts(), this.handleKey);
termWrap = new TermWrap(elem, this.sessionId, this.cmdId, 0, this.getTermOpts(), this.handleKey.bind(this));
this.instances[screenId + "/" + windowId] = termWrap;
return;
}
+5 -1
View File
@@ -52,7 +52,7 @@ class TermWrap {
this.atRowMax = true;
this.usedRows = mobx.observable.box(termOpts.rows);
}
this.terminal = new Terminal({rows: termOpts.rows, cols: termOpts.cols, theme: {foreground: "#d3d7cf"}});
this.terminal = new Terminal({rows: termOpts.rows, cols: termOpts.cols, fontSize: 14, theme: {foreground: "#d3d7cf"}});
this.terminal.open(elem);
if (keyHandler != null) {
this.terminal.onKey(keyHandler);
@@ -66,6 +66,10 @@ class TermWrap {
this.reloadTerminal(0);
}
getFontHeight() : number {
return this.terminal._core.viewport._currentRowHeight;
}
dispose() {
if (this.terminal != null) {
this.terminal.dispose();