diff options
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/github/config.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go index 954bf845..d1b57e10 100644 --- a/bridge/github/config.go +++ b/bridge/github/config.go @@ -21,6 +21,7 @@ import ( "github.com/MichaelMure/git-bug/bridge/core" "github.com/MichaelMure/git-bug/repository" + "github.com/MichaelMure/git-bug/util/interrupt" ) const ( @@ -236,6 +237,16 @@ func promptTokenOptions(owner, project string) (string, error) { return promptToken() } + // Register restore state cleaner before prompting passwords inputs + termState, err := terminal.GetState(int(syscall.Stdin)) + if err != nil { + return "", err + } + + interrupt.RegisterCleaner(func() error { + return terminal.Restore(int(syscall.Stdin), termState) + }) + return loginAndRequestToken(owner, project) } } |