r"""Return a tuple with the prompt string and its visible length. The prompt string has the zero-width brackets recognized by shells (\x01 and \x02) removed. The length ignores anything between those brackets as well as any ANSI escape sequences.
(prompt: str)
| 398 | |
| 399 | @staticmethod |
| 400 | def process_prompt(prompt: str) -> tuple[str, int]: |
| 401 | r"""Return a tuple with the prompt string and its visible length. |
| 402 | |
| 403 | The prompt string has the zero-width brackets recognized by shells |
| 404 | (\x01 and \x02) removed. The length ignores anything between those |
| 405 | brackets as well as any ANSI escape sequences. |
| 406 | """ |
| 407 | out_prompt = unbracket(prompt, including_content=False) |
| 408 | visible_prompt = unbracket(prompt, including_content=True) |
| 409 | return out_prompt, wlen(visible_prompt) |
| 410 | |
| 411 | def bow(self, p: int | None = None) -> int: |
| 412 | """Return the 0-based index of the word break preceding p most |