chjj / blessed

A high-level terminal interface library for node.js.
Other
11.27k stars 533 forks source link

Password input #363

Open RossComputerGuy opened 5 years ago

RossComputerGuy commented 5 years ago

I'm trying to make a login screen and I'm wondering how I'd have the password characters show up as *.

fancyplants commented 5 years ago

It sounds like you're asking for the censor property in the options for textbox, check out http://blessedjs.org/widgets/forms/textbox.html

RossComputerGuy commented 5 years ago

So I just need to set censor to true?

fancyplants commented 5 years ago

I believe so, yes.

Here's an example from one of my input boxes:

const input = blessed.textbox({
    parent: form,
    top: 4,
    left: 5,
    height: 3,
    censor: true,
    mouse: true,
    inputOnFocus: true,
    border: {
      type: 'line',
    },
  })