Skip to content
  • Erik Faye-Lund's avatar
    mingw: reuse tty-version of git_terminal_prompt · afb43561
    Erik Faye-Lund authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The getpass-implementation we use on Windows isn't at all ideal;
    it works in raw-mode (as opposed to cooked mode), and as a result
    does not deal correcly with deletion, arrow-keys etc.
    
    Instead, use cooked mode to read a line at the time, allowing the
    C run-time to process the input properly.
    
    Since we set files to be opened in binary-mode by default on
    Windows, introduce a FORCE_TEXT macro that expands to the "t"
    modifier that forces the terminal to be opened in text-mode so we
    do not have to deal with CRLF issues.
    
    Signed-off-by: Erik Faye-Lund's avatarErik Faye-Lund <kusmabite@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    afb43561