Clear screen on exit #4

Closed
opened 2016-03-14 22:14:18 +00:00 by ghost · 3 comments
ghost commented 2016-03-14 22:14:18 +00:00 (Migrated from github.com)

Hi, cool games! I was playing around with it a bit and noticed the screen didn't clear when exiting (on Linux and Windows). I think this isn't wanted behaviour? I think clearing one more time on exit could solve this.

// classes/interface.js
if (key === 'exit') {
  this.output.write('\u001b[2J\u001b[0;0H'); // this through fat arrow function
  process.exit();
}

Example: Here you can see a leftover snake 🐍 while issuing a new command.

snakeAfterExit

Hi, cool games! I was playing around with it a bit and noticed the screen didn't clear when exiting (on Linux and Windows). I think this isn't wanted behaviour? I think clearing one more time on exit could solve this. ``` javascript // classes/interface.js if (key === 'exit') { this.output.write('\u001b[2J\u001b[0;0H'); // this through fat arrow function process.exit(); } ``` Example: Here you can see a leftover snake :snake: while issuing a new command. ![snakeAfterExit](https://cloud.githubusercontent.com/assets/8117909/13761353/4f078b82-ea38-11e5-887e-5f349e9e1abc.jpg)
mdibaiee commented 2016-03-15 13:21:13 +00:00 (Migrated from github.com)

@verth: Hey! Thanks for the feedback! 👍

See if this branch works on your machine: https://github.com/mdibaiee/node-games/tree/clear-on-exit

You can make a pull-request yourself, too, if you want!

@verth: Hey! Thanks for the feedback! 👍 See if this branch works on your machine: https://github.com/mdibaiee/node-games/tree/clear-on-exit You can make a pull-request yourself, too, if you want!
ghost commented 2016-03-15 14:06:16 +00:00 (Migrated from github.com)

Works like a charm for me, thanks @mdibaiee !

Don't think there is a need to make a pull-request?

Works like a charm for me, thanks @mdibaiee ! Don't think there is a need to make a pull-request?
mdibaiee commented 2016-03-17 11:01:28 +00:00 (Migrated from github.com)

@verth: d3bd75a277 Published a new version to npm, thank you!

@verth: d3bd75a27773772290e265c4c9a8c0d817977667 Published a new version to npm, thank you!
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: thereadme/node-console-games#4
No description provided.