diff --git a/cmd/cmd.go b/cmd/cmd.go
index 968d049b..b0f9681c 100644
--- a/cmd/cmd.go
+++ b/cmd/cmd.go
@@ -561,6 +561,7 @@ func generateInteractive(cmd *cobra.Command, model string) error {
 		line, err := scanner.Readline()
 		switch {
 		case errors.Is(err, io.EOF):
+			fmt.Println()
 			return nil
 		case errors.Is(err, readline.ErrInterrupt):
 			if line == "" {
diff --git a/readline/readline.go b/readline/readline.go
index 4a945bd5..d1fe2c8d 100644
--- a/readline/readline.go
+++ b/readline/readline.go
@@ -76,14 +76,15 @@ func (i *Instance) Readline() (string, error) {
 		}
 
 		r, err := i.Terminal.Read()
-		if err != nil {
-			return "", io.EOF
-		}
 
 		if buf.IsEmpty() {
 			fmt.Print(ClearToEOL)
 		}
 
+		if err != nil {
+			return "", io.EOF
+		}
+
 		if escex {
 			escex = false