xonsh.ptk_shell.updator¶
Has classes that help updating Prompt sections using Threads.
- class xonsh.ptk_shell.updator.AsyncPrompt(name: str, session: PromptSession, executor: Executor)[source]¶
Represent an asynchronous prompt.
- Parameters:
- name: str
what prompt to update. One of [‘message’, ‘rprompt’, ‘bottom_toolbar’]
- session: PromptSession
current ptk session
- invalidate()[source]¶
Create a timer to update the prompt. The timing can be configured through env variables. threading.Timer is used to stop calling invalidate frequently.
- class xonsh.ptk_shell.updator.PromptUpdator(shell)[source]¶
Handle updating multiple AsyncPrompt instances prompt/rprompt/bottom_toolbar
- add(prompt_name: str | None) AsyncPrompt | None [source]¶