Open vallsv opened 2 years ago
@vallsv,
It looks that the reason here is the \n
that accepts the input which causes the input to be validated, and because of that, move the cursor to the start of the line. So, the backspace doesn't have any effect there. A cursor_position
can be set as part of the ValidationError
.
Thanks a lot for the feedback.
But i have checked again with a raw ptpython shell. And the behaviour is not the same. The return key do not move the cursor at start. In fact i guess after each key press the validator is executed. Could it be something setup by ptpython itself?
Else, ill try to return the actual cursor position as you explained, that's not a big deal. Or i anyway can try to setup a test based on this known behaviour. Thanks a lot.
Hi,
I try to setup unit tests on some code based on
prompt
. But i am not able to write backspace to the input stream with validator. It sounds like after the first\n
aborted by the validator, the\b
behave like a left arrow key.I don't have such behaviour outside of the unittest.
The result it
Do you have any idea what's wrong or how i should check such key sequence?