Testcase 1 is just to demonstrate why the \STX is needed, just as the wiki says. Enter too many chars, press enter, recall the last entry, pres pos1, edit, press enter, and see that the cursor position was off. So far, nothing new.
Testcase 2 shows the official, working solution.
Testcase 3 uses a multi-line prompt following the official solution. It works, but now weird characters show up in the first line (tested on xfce4-terminal)
Testcase 4 shows what's necessary to combine working cursor positions with multiline prompts. It works, but it is neither consistent nor documented.
Testcase 5 shows that the issue goes further once you need additional control characters. One application is if you want to pipe ghci output through a post processor.
I'm not sure how much of this is a bug and how much of this is just a gap in the documentation.
Consider these testcases:
Testcase 1 is just to demonstrate why the \STX is needed, just as the wiki says. Enter too many chars, press enter, recall the last entry, pres pos1, edit, press enter, and see that the cursor position was off. So far, nothing new. Testcase 2 shows the official, working solution. Testcase 3 uses a multi-line prompt following the official solution. It works, but now weird characters show up in the first line (tested on xfce4-terminal) Testcase 4 shows what's necessary to combine working cursor positions with multiline prompts. It works, but it is neither consistent nor documented. Testcase 5 shows that the issue goes further once you need additional control characters. One application is if you want to pipe ghci output through a post processor.
I'm not sure how much of this is a bug and how much of this is just a gap in the documentation.