From 15c3f2fc10cc446ad64f7eb263c1a1fd4986fdef Mon Sep 17 00:00:00 2001 From: sawka Date: Mon, 20 Jun 2022 13:19:53 -0700 Subject: [PATCH] fix getDefaultSession, set foreground color to be not fff --- src/session.ts | 7 +++++++ src/term.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/session.ts b/src/session.ts index 99f2c4373..86d995916 100644 --- a/src/session.ts +++ b/src/session.ts @@ -76,6 +76,7 @@ class Session { return termWrap; } termWrap = new TermWrap(line.sessionid, line.cmdid); + console.log("create term", termWrap); this.termMap[termKey] = termWrap; this.termMapById[termWrap.termId] = termWrap; termWrap.initialized = true; @@ -104,7 +105,12 @@ class Session { } } +var DefaultSession : Session = null; + function getDefaultSession() : Session { + if (DefaultSession != null) { + return DefaultSession; + } let windowLines = GlobalLines.get(); let session = new Session(); session.sessionId = GSessionId; @@ -113,6 +119,7 @@ function getDefaultSession() : Session { session.windows = [ {sessionid: GSessionId, windowid: GWindowId, name: "default", lines: windowLines}, ]; + DefaultSession = session; return session; } diff --git a/src/term.ts b/src/term.ts index f4dc46bf7..121073bda 100644 --- a/src/term.ts +++ b/src/term.ts @@ -39,7 +39,7 @@ class TermWrap { this.termId = uuidv4(); this.sessionId = sessionId; this.cmdId = cmdId; - this.terminal = new Terminal({rows: 2, cols: 80}); + this.terminal = new Terminal({rows: 2, cols: 80, theme: {foreground: "#d3d7cf"}}); } destroy() {