-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how we can use requestPassword
?
#4
Comments
@A1Gard have you figured this out yet? |
@A1Gard i found the solution: window.FakeTerminal.command.shutdown = function (instance) {
window.FakeTerminal.command.apply(this, arguments);
var base = this;
base.info = function () {
return {
private: false,
description: 'This command shuts the os down.'
};
};
base.execute = function () {
instance.output.write(`<question>Please enter your password:</question>`);
instance.input.request("password").done(function(value) {
if (value == "AtyysCyBDnESysTmsT1000") {
instance.output.write(`<info>Initiating shutdown sequence...</info>`);
base.deferred.resolve();
} else {
instance.output.write(`<error>ERROR: Aborting shutdown sequence.</error>`);
instance.output.write(`<error>ERROR: Incorrect password.</error>`);
base.deferred.resolve();
};
}).fail(function() {
instance.output.write("ERROR FATAL");
base.deferred.resolve();
});
return base.deferred.promise();
};
return base;
}; |
@hellopablo if you do look into the repo, please create a docs site, like xterm.js So users can refer to it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My sample:
What's the problem?
The text was updated successfully, but these errors were encountered: