diff --git a/php/WP_CLI/Dispatcher/Subcommand.php b/php/WP_CLI/Dispatcher/Subcommand.php
index <HASH>..<HASH> 100644
--- a/php/WP_CLI/Dispatcher/Subcommand.php
+++ b/php/WP_CLI/Dispatcher/Subcommand.php
@@ -121,7 +121,11 @@ class Subcommand extends CompositeCommand {
 
 		echo $question;
 
-		return stream_get_line( STDIN, 1024, "\n" );
+		$ret = stream_get_line( STDIN, 1024, "\n" );
+		if ( Utils\is_windows() && "\r" === substr( $ret, -1 ) ) {
+			$ret = substr( $ret, 0, -1 );
+		}
+		return $ret;
 	}
 
 	/**
Make sure prompt return doesn't include \r on Windows.