From 2224e5745c92e085b8e25cfb89b0b75103b124b9 Mon Sep 17 00:00:00 2001 From: Eugene Obrezkov Date: Mon, 11 May 2020 13:23:36 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20deck=20is=20not=20clearin?= =?UTF-8?q?g=20up=20canvas=20when=20showing\exiting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Deck instance is created, it does not reset the canvas by default. The same applies when exiting the deck, it does not reset it. With this commit it will reset the canvas and show\hide cursor by default, when entering the presentation mode and exiting from it. --- packages/kittik-deck/src/Deck.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/kittik-deck/src/Deck.ts b/packages/kittik-deck/src/Deck.ts index 9459f36..a0300d1 100644 --- a/packages/kittik-deck/src/Deck.ts +++ b/packages/kittik-deck/src/Deck.ts @@ -19,7 +19,7 @@ export declare interface Deck { } export class Deck extends EventEmitter { - public canvas: Canvas = Canvas.create(); + public canvas: Canvas = Canvas.create().reset().hideCursor(); private readonly slides: Slide[] = []; private isRendering = false; private currentSlideIndex = 0; @@ -117,6 +117,7 @@ export class Deck extends EventEmitter { process.stdin.pause(); process.stdin.removeAllListeners(); + this.canvas.reset().showCursor(); this.emit('exit'); }