How to use the ansi-escapes.cursorShow function in ansi-escapes

To help you get started, we’ve selected a few ansi-escapes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serverless / components / src / cli / index.js View on Github external
// Write content
    let content = ' '
    if (this._.useTimer) {
      content += ` ${grey(this._.seconds + 's')}`
      content += ` ${grey(figures.pointerSmall)}`
    }
    content += ` ${stage}`
    content += ` ${grey(figures.pointerSmall)} ${this._.parentComponent}`
    content += ` ${grey(figures.pointerSmall)} ${message}`
    process.stdout.write(content)

    // Put cursor to starting position for next view
    console.log(os.EOL) // eslint-disable-line
    process.stdout.write(ansiEscapes.cursorLeft)
    process.stdout.write(ansiEscapes.cursorShow)

    if (reason === 'error') {
      process.exit(1)
    } else {
      process.exit(0)
    }
  }
github serverless / components / src / cli / Context.js View on Github external
// Write content
    this.log()
    let content = ''
    if (this._.timer) {
      content += `${grey(this._.timerSeconds + 's')}`
      content += ` ${grey(figures.pointerSmall)} `
    }
    content += `${this._.entity} `
    content += `${grey(figures.pointerSmall)} ${message}`
    process.stdout.write(content)

    // Put cursor to starting position for next view
    console.log(os.EOL) // eslint-disable-line
    process.stdout.write(ansiEscapes.cursorLeft)
    process.stdout.write(ansiEscapes.cursorShow)

    if (reason === 'error') {
      process.exit(1)
    } else {
      process.exit(0)
    }
  }
github jest-community / jest-watch-typeahead / src / shared / pattern_prompt.js View on Github external
run(onSuccess: Function, onCancel: Function, options?: { header: string }) {
    this._pipe.write(ansiEscapes.cursorHide);
    this._pipe.write(ansiEscapes.clearScreen);

    if (options && options.header) {
      this._pipe.write(`${options.header}\n`);
      this._currentUsageRows = usageRows + options.header.split('\n').length;
    } else {
      this._currentUsageRows = usageRows;
    }

    this._pipe.write(usage(this._entityName));
    this._pipe.write(ansiEscapes.cursorShow);

    this._prompt.enter(this._onChange.bind(this), onSuccess, onCancel);
  }
github heroku / cli / cli.js View on Github external
function onexit (options) {
  const ansi = require('ansi-escapes')
  process.stderr.write(ansi.cursorShow)
  if (options.exit) process.exit(1)
}
github speedracer / speedracer / lib / display.js View on Github external
const showCursor = () =>
process.stdout.write(ansi.cursorShow)
github heroku / cli / packages / heroku-cli-autocomplete / src / legacy.js View on Github external
process.once('exit', () => {
        if (process.stderr.isTTY) {
          process.stderr.write(ansi.cursorShow)
        }
      })
      return c.run(ctx)
github IndigoUnited / node-planify / reporters / blocks.js View on Github external
finish() {
                stdout(ansiEscapes.cursorShow);
            },
        },
github jdxcode / smooth-progress / lib / progress.js View on Github external
function done () {
    render()
    bar.complete = true
    stderr.write('\n')
    stderr.write(ansi.cursorShow)
  }
github heroku / heroku-cli-util / lib / prompt.js View on Github external
function stop () {
      if (!options.hide) {
        stderr.write(
          ansi.cursorHide +
            ansi.cursorLeft +
            options.prompt +
            input.replace(/./g, '*') +
            '\n' +
            ansi.cursorShow)
      } else {
        stderr.write('\n')
      }
      stdin.removeListener('data', fn)
      stdin.setRawMode(false)
      stdin.pause()
    }