8000 Bug: CLI does not properly restore terminal state if interrupted during password input · Issue #1378 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content
Bug: CLI does not properly restore terminal state if interrupted during password input #1378
Closed
@dwahler

Description

@dwahler

OS Information

  • coder --version: Coder v0.5.5-devel+97a95f1
  • OS image: coder-dogfood/master/coder-dev-ubuntu (Ubuntu 20.04.3 LTS)

Steps to Reproduce

  1. Run a command that tries to read a password from the terminal, e.g. coder login
  2. While the password prompt is waiting for input, kill the program (e.g. by pressing Ctrl-C)

Expected

The program should exit and the terminal should be restored to the same state it was in before the command was run.

Actual

The terminal's "echo" flag remains disabled, which means you can't see what you're typing into the shell until you run a command like reset to restore it.

Notes

Since we prompt for the password twice, if you make a typo entering it the first time then you're basically guaranteed to hit this bug, because the second prompt will keep asking for input until either the passwords match or the program is killed.

Of course, if we get a SIGKILL then there's nothing we can do to clean up, but we should be able to restore the terminal correctly if we receive any other signal.

Metadata

Metadata

Assignees

Labels

apiArea: HTTP APIcliArea: CLI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0