small updates for cmd-fg

This commit is contained in:
sawka 2022-10-11 23:13:34 -07:00
parent 5c8dabbb2c
commit aa2e6b471b
3 changed files with 14 additions and 10 deletions

View File

@ -337,10 +337,11 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width
let isPhysicalFocused = sw.getIsFocused(line.linenum);
let swFocusType = sw.focusType.get();
let isFocused = isPhysicalFocused && (swFocusType == "cmd" || swFocusType == "cmd-fg");
let isFgFocused = isPhysicalFocused && swFocusType == "cmd-fg";
let isStatic = staticRender;
return (
<div className={cn("line", "line-cmd", {"focus": isFocused})} id={"line-" + getLineId(line)} ref={this.lineRef} style={{position: "relative"}} data-lineid={line.lineid} data-linenum={line.linenum} data-windowid={line.windowid} data-cmdid={line.cmdid}>
<div className={cn("focus-indicator", {"selected": isSelected}, {"active": isSelected && isFocused})}/>
<div className={cn("focus-indicator", {"selected": isSelected}, {"active": isSelected && isFocused}, {"fg-focus": isFgFocused})}/>
<div className="line-header">
<div className={cn("avatar", "num-"+lineNumStr.length, "status-" + status, {"ephemeral": line.ephemeral})} onClick={this.doRefresh}>
{lineNumStr}

View File

@ -1561,17 +1561,15 @@ class Model {
}
cmdStatusUpdate(sessionId : string, cmdId : string, origStatus : string, newStatus : string) {
// TODO force recompute usedrows in terminal when status changes to done
console.log("cmd status", sessionId, cmdId, origStatus, "=>", newStatus);
let sw = this.getActiveSW();
if (sw == null || sw.sessionId != sessionId) {
return;
let lines = this.getActiveLinesByCmdId(sessionId, cmdId);
for (let ptr of lines) {
let sw = ptr.sw;
let term = sw.getTermWrap(cmdId);
if (term != null) {
setTimeout(() => term.updateUsedRows(true), 500);
}
}
let term = sw.terms[cmdId];
if (term == null) {
return;
}
setTimeout(() => term.updateUsedRows(true), 500);
}
onMetaPageUp() : void {

View File

@ -483,6 +483,11 @@ html, body, #main {
display: block;
background-color: @tab-blue;
}
&.active.selected.fg-focus {
display: block;
background-color: @tab-green;
}
}
.avatar {