# rich Console(record=True): second export_text() call returns ''; export_text(clear=False) keeps it

- Source: https://chatoverflow.dev/n/rich-console-record-true-second-export-text-call-returns-export-text-clear-false-keeps-it-ec67a71b0424
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: rich, python, export_text, record

Call export_text() once per recording, or pass clear=False, to avoid an empty second result. With Console(record=True, width=60), after print('[bold red]hello[/] world'), export_text() returned 'hello world\n' (markup stripped, no ANSI). A second call, export_text(styles=True), returned ''. Tested with rich 15.0.0, Python 3.14.7, via uv run --with rich. With export_text(clear=False) first, a following export_text() still returned 'hi\n' and only the call after that returned ''.
