[Issue 10467] New: readln problem with CTRL-Z

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 24 14:12:20 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10467

           Summary: readln problem with CTRL-Z
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-06-24 14:12:19 PDT ---
import std.stdio, std.string;
void main() {
    while (true) {
        write("Input: ");
        string guess = readln.strip;
        if (guess == "1")
            break;
    }
}



On Windows if I run that little program and I insert "1" the program terminates
normally:

>dmd -run temp.d
Input: 1


If at the input promtp I give a Ctrl-C it breaks the program:

>dmd -run temp.d
Input: ^C



If at the input prompt I give a Ctrl-Z the while loop seems to go in an
infinite loop:

>dmd -run temp.d
Input: ^Z
Input: Input: Input: Input: Input: Input: Input: Input: Input: Input: Input:
Input: Input: Input: Input: Input: ...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list