question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `vorpal.ui.clear` command to API

See original GitHub issue

hi, I implemented a clear command in one of my vorpal application following your answers in this post http://stackoverflow.com/questions/8813142/clear-terminal-window-in-node-js-readline-shell/32871585#32871585?newreg=0fd7e6b366544c72b82496cd4c077973

The problem is that the cursor lost in the console after executing the clear command, as the screenshots below:

Before clear,

image

After clear,

image

Notice that the grey cursor had gone.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:3
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
eistaacommented, Mar 14, 2016

@mamboer: It’s ANSI escape codes. A breakdown of \u001b[2J\u001b[0;0H is:

  • \u001b is the escape character, together with [ it becomes a Control Sequence Introducer (CSI)
  • CSI 2J is the sequence for clearing the entire screen
  • CSI 0;0H is the sequence for moving the cursor to row 0, column 0
3reactions
Maxtoroscommented, May 6, 2016

Hey guys am using this command to ‘clean’ the screen , especially after a messy execution : vorpal .command('clean') .action(function (args,cb) { process.stdout.write ("\u001B[2J\u001B[0;0f"); cb(); });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vorpal
Vorpal has built-in tabbed autocompletion for your commands and options, persistent command history, piping and automated help pages.
Read more >
How can I add variadic support to options of a Vorpal application
Currently developing a vorpal application and am trying to add variadic support to one of my commands. However adding the variadic syntax to ......
Read more >
@moleculer/vorpal - npm
With a simple and powerful API, Vorpal opens the door to a new breed of rich, immersive CLI environments like cash and wat....
Read more >
dthree/vorpal - Gitter
Is there an easy way to add a confirmation to a command with vorpal? ... .command('target', 'Set or clear target for session.') .option('-s...
Read more >
vorpal Alternatives - Node.js Command Line Utilities | LibHunt
Create a .js file and add the following: const vorpal = require('vorpal')(); vorpal .command('foo', ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found