diff --git a/src/session.ts b/src/session.ts index 99f2c437..86d99591 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 f4dc46bf..121073bd 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() {