0

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!

mljistcart
  • 45
  • 6

1 Answers1

0

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);
Marcel
  • 1,443
  • 2
  • 14
  • 24
  • Thanks for your help marcel! In reality , what I am really trying to do is changing wtty.write(opts.prompt + ':') to wtty.write(opts.prompt + 'something else') assuming that opts.prompt='Password'. It is strange because when I do debug on Visual Studio Code seems not to call that function (getpass). About your suggestion, where exactly I have to write that code on Hyper? On index.js? The things is, again, it seems not to call getpass on that file. – mljistcart Dec 03 '17 at 15:46