In case other prompt_toolkit apps have to run in parallel to this one (e.g. in madbg), create_app_session must be used to prevent mixing up between them. According to the prompt_toolkit docs: > If you need multiple applications running at the same time, you have to create a
(self)
| 91 | self.pt_app = PromptSession(**options) |
| 92 | |
| 93 | def _prompt(self): |
| 94 | """ |
| 95 | In case other prompt_toolkit apps have to run in parallel to this one (e.g. in madbg), |
| 96 | create_app_session must be used to prevent mixing up between them. According to the prompt_toolkit docs: |
| 97 | |
| 98 | > If you need multiple applications running at the same time, you have to create a separate |
| 99 | > `AppSession` using a `with create_app_session():` block. |
| 100 | """ |
| 101 | with create_app_session(): |
| 102 | return self.pt_app.prompt() |
| 103 | |
| 104 | def cmdloop(self, intro=None): |
| 105 | """Repeatedly issue a prompt, accept input, parse an initial prefix |