fix getDefaultSession, set foreground color to be not fff

This commit is contained in:
sawka 2022-06-20 13:19:53 -07:00
parent d679ff7cf3
commit 15c3f2fc10
2 changed files with 8 additions and 1 deletions

View File

@ -76,6 +76,7 @@ class Session {
return termWrap; return termWrap;
} }
termWrap = new TermWrap(line.sessionid, line.cmdid); termWrap = new TermWrap(line.sessionid, line.cmdid);
console.log("create term", termWrap);
this.termMap[termKey] = termWrap; this.termMap[termKey] = termWrap;
this.termMapById[termWrap.termId] = termWrap; this.termMapById[termWrap.termId] = termWrap;
termWrap.initialized = true; termWrap.initialized = true;
@ -104,7 +105,12 @@ class Session {
} }
} }
var DefaultSession : Session = null;
function getDefaultSession() : Session { function getDefaultSession() : Session {
if (DefaultSession != null) {
return DefaultSession;
}
let windowLines = GlobalLines.get(); let windowLines = GlobalLines.get();
let session = new Session(); let session = new Session();
session.sessionId = GSessionId; session.sessionId = GSessionId;
@ -113,6 +119,7 @@ function getDefaultSession() : Session {
session.windows = [ session.windows = [
{sessionid: GSessionId, windowid: GWindowId, name: "default", lines: windowLines}, {sessionid: GSessionId, windowid: GWindowId, name: "default", lines: windowLines},
]; ];
DefaultSession = session;
return session; return session;
} }

View File

@ -39,7 +39,7 @@ class TermWrap {
this.termId = uuidv4(); this.termId = uuidv4();
this.sessionId = sessionId; this.sessionId = sessionId;
this.cmdId = cmdId; this.cmdId = cmdId;
this.terminal = new Terminal({rows: 2, cols: 80}); this.terminal = new Terminal({rows: 2, cols: 80, theme: {foreground: "#d3d7cf"}});
} }
destroy() { destroy() {