-
Notifications
You must be signed in to change notification settings - Fork 732
messy code is displayed with prompt occasionally #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @nanaal, This is a cursor-position-response that should have been processed, but was printed instead. Thanks, |
Hi @jonathanslenders , Below are the info of operating system and terminal application. Nana [root@yywcdr-1 ~]# cat /etc/redhat-release |
I can also reproduce this fairly easily by triggering fast prompt redraws by mashing Enter on the prompt or when printing a large set of tabulated data.
Disabling cooked mode (#487) doesn't seem to change anything for me. Testing https://github.com/jonathanslenders/python-prompt-toolkit/pull/339/files, I no longer see CPRs. I do, however, see seemingly random newlines between prompts (stdout proxying is on):
|
Same issue as #456. I'll need to check if that PR fixes it. |
I tested the branch (it's old, so you probably have to merge with master) and it doesn't fix the problem for me. Also sometimes it prints the first prompt twice. |
Re. https://github.com/jonathanslenders/python-prompt-toolkit/pull/339/files I tested it by cherry-picking to master. |
Hi everyone, could you test whether this issue still happens on the 2.0 branch? |
I modified my patch in #456 to work in 2.0, and it reproduced there. |
jonathanslenders,
When I run prompt with below format, messy code will be displayed occasionally as below. I am not sure whether it is a bug of python-prompt-toolkit. Can you help to have a look?
Thanks a lot in advance.
Nana
^[[35;1R file size limit(MB): 50
^[[70;1R has release extension: N
^[[70;1R node name: CGF01
`class EmailValidator(Validator):
self.func = None
def validate(self, document):
if len(document.text) > 0 and document.text[-1] == "!":
return
if self.func == None:
return
tmp_val = self.func(document.text)
if len(tmp_val):
raise ValidationError(message=tmp_val,
cursor_position=len(document.text))
for key, val in self.__setMap.items():
validator = EmailValidator();
validator.func = val
text = prompt(' %s: ' %key, default='%s' %str(self.__getMapkey), validator=validator)
if len(text) > 0 and text[-1] == "!":
return True
`
The text was updated successfully, but these errors were encountered: