jQuery terminal: how to unset mask?

Viewed 108

I'm using jQuery Terminal to build my site.

Now I'm building signin command:

signin: function() {
  this.read("user id: ").then(userId =>
  this.set_mask('*').read("password: ").then(password =>
    // signin process
  ));
}

This code works correctly. But after this process set_mask('*') will remain.

I've tried this.set_mask(false); but it doesn't work. How to unset this mask?

Any help is appreciated

2 Answers

My solution and here is an example of variable declarations and a bit of code.

var term = $(".terminal").terminal({
  signin: function() {
    this.read("user id: ").then(userId =>
    this.set_mask('*').read("password: ").then(password =>
      // signin process
    term.set_mask(false);    // it works!
    // this.set_mask(false); // it doesn't work
    ));
  }
});

Thank you and hope this code will help anyone

Maybe that helps.

set_mask is defined as a boolean
set_mask(false or true)

I'm not familiar with Jquery Terminal. Maybe you can use for example if (mask....) {

mask

Just explore the examples https://terminal.jcubic.pl/examples.php

Related