Skip to content

Permission prompt doesn't wait for user input — readline raw mode conflict #334

Closed

Description

@ceverson70

Bug

Permission prompt shows Allow? [y/n/a] but immediately proceeds to execute the tool without waiting for user input. The /dev/tty read fails because readline has the terminal in raw mode — bufio.Scanner can't read a line when there are no line endings in raw mode.

Root Cause

readline puts the terminal in raw mode. Opening /dev/tty gives access to the same terminal, but in raw mode individual keystrokes don't produce lines — bufio.Scanner.Scan() returns immediately.

Fix

Need to either:

  1. Temporarily restore cooked mode via termios before reading, or
  2. Read a single byte (y/n/a) instead of a line, or
  3. Use readline's own input facility

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions