A few issues with EOF being received at PS2:
The setting of ignoreeof is ignored at PS2: bash --norc -o ignoreeof $ uname \ > ^D Linux (bash exits) If the previous line didn't terminate the current token, ^D causes the token (rather than the command) to be terminated and a new PS2 to be printed. The history code treats them as one word. bash --norc $ echo A\ > ^D > B A B $ !! echo AB AB And perhaps most surprising, if PS0 contains a command substitution, the wrong prompts are shown: PS0='$(:)' bash --norc $ uname \ > ^DLinux # The command is executed (without a newline printed) > uname \ # PS2 is displayed again, but we are actually reading a new cmd $ -n # PS1 is used for the continuation line localhost