Title: Rich Console Status Visual Bug · Issue #1578 · python-cmd2/cmd2 · GitHub
Open Graph Title: Rich Console Status Visual Bug · Issue #1578 · python-cmd2/cmd2
X Title: Rich Console Status Visual Bug · Issue #1578 · python-cmd2/cmd2
Description: Description Using the Cmd.p* output methods from while a rich status spinner is running causes the messages to merge on the terminal. Environment Windows 11 Windows Terminal Version: 1.23.20211.0 Python 3.12.2 cmd2-3.2.0 Steps to Reprodu...
Open Graph Description: Description Using the Cmd.p* output methods from while a rich status spinner is running causes the messages to merge on the terminal. Environment Windows 11 Windows Terminal Version: 1.23.20211.0 P...
X Description: Description Using the Cmd.p* output methods from while a rich status spinner is running causes the messages to merge on the terminal. Environment Windows 11 Windows Terminal Version: 1.23.20211.0 P...
Opengraph URL: https://github.com/python-cmd2/cmd2/issues/1578
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rich Console Status Visual Bug","articleBody":"### Description\nUsing the `Cmd.p*` output methods from while a rich status spinner is running causes the messages to merge on the terminal.\n\n### Environment\n- Windows 11\n- Windows Terminal Version: 1.23.20211.0\n- Python 3.12.2\n- cmd2-3.2.0\n\n### Steps to Reproduce\n```python\nimport time\nfrom argparse import Namespace\n\nfrom cmd2 import Cmd, with_category\nfrom rich.console import Console\n\nTEST_CATAGORY: str = \"Test Commands\"\nconsole = Console()\n\n\nclass MyCmd(Cmd):\n @with_category(TEST_CATAGORY)\n def do_exemplar(self, args: Namespace):\n \"\"\"This is what the status is expected to look like.\"\"\"\n with console.status(\"Working!\"):\n for _ in range(10):\n console.log(\"console.log: Hello from cmd!\")\n time.sleep(0.1)\n\n @with_category(TEST_CATAGORY)\n def do_problem(self, args: Namespace):\n \"\"\"Demonstrate the problem.\"\"\"\n with console.status(\"Working!\"):\n for _ in range(10):\n self.pwarning(\"pwarning: Hello from cmd!\")\n time.sleep(0.1)\n\n\nif __name__ == \"__main__\":\n MyCmd().cmdloop()\n```\n\n\u003cimg width=\"390\" height=\"456\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/a7141af4-b665-4709-a7f1-8e3b341425a0\" /\u003e\n\n### Solutions\n\nI did some digging into `rich` and `cmd2` and could not find a way to insert my own console instance into the `cmd2.Cmd` for use with the print methods (`cmd2.Cmd.p*`). If there is an obvious solution, please let me know. I have been a long time user of this package and the new changes integrating `rich` are very exciting.\n\nOne possible fix would be to not create a new console object for each call to the print methods. I am not really sure how easy that will be to change or maintain. There could be a console attribute for the `cmd2.Cmd` class or `cmd2` could manage a global console object like how `rich` [does](https://github.com/Textualize/rich/blob/master/rich/__init__.py#L23).","author":{"url":"https://github.com/ShiftPoster","@type":"Person","name":"ShiftPoster"},"datePublished":"2026-02-19T01:44:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/1578/cmd2/issues/1578"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:337e12af-d19c-66db-46e4-c8cdf2fe11dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6AC:34BFFD:2CBE40C:3D91A30:6A4F0719 |
| html-safe-nonce | 3be620edfeb5f635bb15bf23b8a959fe372fd6f0da3d2806e699997671c9d5e0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkFDOjM0QkZGRDoyQ0JFNDBDOjNEOTFBMzA6NkE0RjA3MTkiLCJ2aXNpdG9yX2lkIjoiNTMyMjMxNTMxMDI1MzkzNDM2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 62009b26ec68f20a6d37d42597447b02b990d6bd246aad12f8d2292a24e85af8 |
| hovercard-subject-tag | issue:3960561642 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-cmd2/cmd2/1578/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f91ea84e6e1b7b22d0316b3b648cf9bddddc13047cd3109d8a7e4cb9f672c824/python-cmd2/cmd2/issues/1578 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f91ea84e6e1b7b22d0316b3b648cf9bddddc13047cd3109d8a7e4cb9f672c824/python-cmd2/cmd2/issues/1578 |
| og:image:alt | Description Using the Cmd.p* output methods from while a rich status spinner is running causes the messages to merge on the terminal. Environment Windows 11 Windows Terminal Version: 1.23.20211.0 P... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ShiftPoster |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-cmd2/cmd2 git https://github.com/python-cmd2/cmd2.git |
| octolytics-dimension-user_id | 17161025 |
| octolytics-dimension-user_login | python-cmd2 |
| octolytics-dimension-repository_id | 51442999 |
| octolytics-dimension-repository_nwo | python-cmd2/cmd2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51442999 |
| octolytics-dimension-repository_network_root_nwo | python-cmd2/cmd2 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width