Skip to content

messy code is displayed with prompt occasionally #496

Open
@nanaal

Description

@nanaal

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
`

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions