Skip to content

Commit 2224e57

Browse files
committed
fix: 🐛 deck is not clearing up canvas when showing\exiting
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.
1 parent c9b0942 commit 2224e57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/kittik-deck/src/Deck.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export declare interface Deck {
1919
}
2020

2121
export class Deck extends EventEmitter {
22-
public canvas: Canvas = Canvas.create();
22+
public canvas: Canvas = Canvas.create().reset().hideCursor();
2323
private readonly slides: Slide[] = [];
2424
private isRendering = false;
2525
private currentSlideIndex = 0;
@@ -117,6 +117,7 @@ export class Deck extends EventEmitter {
117117
process.stdin.pause();
118118
process.stdin.removeAllListeners();
119119

120+
this.canvas.reset().showCursor();
120121
this.emit('exit');
121122
}
122123

0 commit comments

Comments
 (0)