func (p *terminalPrompter) PromptPassword(prompt string) (string, error) {
	if p.supported {
		p.rawMode.ApplyMode()
		defer p.normalMode.ApplyMode()
		return p.State.PasswordPrompt(prompt)
	}
	if !p.warned {
		PrintWarnMsg("!! Unsupported terminal, password will be echoed.")
		p.warned = true
	}
	fmt.Print(prompt)
	pass, err := p.State.Prompt("")
	fmt.Println()
	return pass, err
}
PromptPassword displays the given prompt to the user and requests some textual
data to be entered, but one which must not be echoed out into the terminal.
The method returns the input provided by the user.
package cmd
import (
	"bytes"
	"encoding/json"
	"fmt"
	"os"
	"strings"
	"github.com/gallactic/gallactic/crypto"
	"github.com/gallactic/gallactic/keystore/key"
	"github.com/peterh/liner"
)
type terminalPrompter struct {
	*liner.State
	warned     bool
	supported  bool
	normalMode liner.ModeApplier
	rawMode    liner.ModeApplier
}
var Stdin = newTerminalPrompter()
func newTerminalPrompter() *terminalPrompter {
	p := new(terminalPrompter)
	normalMode, _ := liner.TerminalMode()
	p.State = liner.NewLiner()
	rawMode, err := liner.TerminalMode()
	if err != nil || !liner.TerminalSupported() {
		p.supported = false
	} else {
		p.supported = true
		p.normalMode = normalMode
		p.rawMode = rawMode
		normalMode.ApplyMode()
	}
	p.SetCtrlCAborts(true)
	p.SetTabCompletionStyle(liner.TabPrints)
	p.SetMultiLineMode(true)
	return p
}