简体   繁体   中英

How to edit the string “Password: key symbol ” printed on Sudo (anything) command?

I came here to ask for your help because I'm a little lost in this challenge I have in hands along some days.

My goal is simple (although I do not know if it's easy to implement on code) - edit/modify the string "Password: " printed on Sudo (anything) command which is usually accompanied by a key symbol on right. My goal is not only modify the sting for another one but also in case of that possibility, replace for another symbols. Looking on Mac OS or iTerm terminals we can see clearly examples of what I'm describing typing "sudo whoami".

Looking on Hyper Open Source terminal to accomplish my objective I don't understand why am I unnable to edit that string on node_modules/getpass/lib/index.js - line 46 (for who has this terminal installed). It is the only file on this program where the word is supposed to be printed. After modifying the word/string, nothing changed. Am I looking in the wrong place? Is it something more internal/deep to which I do not have access?

I hope you can elucidate me on the way forward. Thanks for your time!

Are you trying to change it in Hyper itself?

You're referencing the module node-getpass , its getPass function looks like this:

.getPass([options, ]callback)

if you pass an object with a prompt property you can set a custom prompt, instead of the text Password.

let options = {
    prompt: "Type your password:"
}

const pass = require('getpass')
pass.getPass(options, callback);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM