MCPcopy
hub / github.com/Doorman11991/smallcode / enter

Method enter

src/tui/fullscreen.js:231–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229 // ─── Lifecycle ───────────────────────────────────────────────────────
230
231 enter() {
232 this.active = true;
233
234 // The TerminalController owns alt-buffer / raw-mode / mouse-tracking /
235 // bracketed-paste setup and — critically — guarantees teardown on suspend
236 // (Ctrl+Z), termination, and crashes (issue #71). On resume it redraws.
237 if (!this._terminal) {
238 this._terminal = new TerminalController({
239 onResume: () => { this._computeLayout(); this.render(); },
240 });
241 }
242 this._terminal.enter();
243
244 // Store a direct reference to the real stdout.write (before any overrides)
245 this._rawWrite = this._terminal.rawWrite;
246
247 // Handle resize
248 process.stdout.on('resize', () => this._onResize());
249
250 // Handle raw keypresses
251 process.stdin.on('data', (data) => this._onKeypress(data));
252
253 this._computeLayout();
254 this.render();
255 }
256
257 leave() {
258 if (!this.active) return;

Callers 2

runTUIFunction · 0.95

Calls 4

_computeLayoutMethod · 0.95
renderMethod · 0.95
_onResizeMethod · 0.95
_onKeypressMethod · 0.95

Tested by

no test coverage detected