Skip to content

4.0.0-b6 (2026-04-29)

Pre-release
Pre-release

Choose a tag to compare

@kmvanbrunt kmvanbrunt released this 29 Apr 15:03
· 4 commits to main since this release
0285e8e

What's Changed

  • Breaking Changes
    • Removed always_show_hint settable as it provided a poor user experience with
      prompt-toolkit
    • cmd2 redirection only captures output directed to self.stdout (e.g., via
      self.poutput()). Standard print() calls write directly to sys.stdout and are not
      captured. However, print() calls within pyscripts and the interactive Python shell are
      treated as command output and sent to self.stdout, allowing them to be captured.
    • Verbose help table descriptions are no longer generated from help function output. The system
      now relies exclusively on command function docstrings.
  • Enhancements
    • Added HelpFormatterRenderable protocol and HelpContent type alias to support context-aware
      help content in argparse.
    • The print() function available in a pyscript writes to self.stdout and respects the
      allow_style setting. It also supports printing Rich objects.
    • Added Cmd2ArgumentParser.output_to() context manager to temporarily set the output stream
      during argparse operations. This is helpful for directing output for functions like
      parse_args(), which default to sys.stdout and lack a file argument.
  • Bug Fixes
    • Fixed ArgparseCompleter.print_help() not passing file stream to recursive call.
    • Fixed issue where constants.REDIRECTION_TOKENS was being mutated.

Full Changelog: 4.0.0-b5...4.0.0-b6