Skip to content

Releases

4.4.4 (2026-11-30)

Choose a tag to compare

@tleonhardt tleonhardt released this 01 Dec 00:32

What's Changed

  • Bug Fixes
    • Tab completion of a match which needs quotes, such as a file name with a space, now takes one press of Tab instead of two. The opening quote is inserted and the completion carries on in the same key press.
    • A match chosen from the completion menu now closes its quote and adds a trailing space. Previously the quote was left open, and running the command failed with Invalid syntax: No closing quotation. A directory still leaves its quote open so the rest of the path can be completed. See the Quotes Added by Completion documentation for details.
      • Completions.allow_finalization used to be ignored when there were several matches. It now decides whether a match chosen from them closes its quote. If you have written a completer which offers matches the user keeps completing, like directories, alongside other matches, return allow_finalization=False for those results so the quote stays open.
    • On Windows, paths typed with forward slashes now complete properly. Shell command completion treats text such as ./my and C:/tools/my as a path instead of searching PATH for a command of that name. Path completion keeps the separators as they were typed, so the first Tab extends the part which several matching names share.
    • history --output-file and history --edit now write their files as UTF-8, which is what run_script reads. On a locale whose encoding is not UTF-8, such as Korean or Japanese Windows, a history with non-ASCII text was written in the locale's encoding. run_script then rejected the saved file as not being ASCII or UTF-8 text, and history --edit did not run the edited commands.
    • run_script now skips a UTF-8 byte order mark at the start of a script file, which some Windows editors and Windows PowerShell 5.1 write. Previously the mark became part of the first command, so that command was not recognized.
    • run_pyscript now reads a script the way Python does, instead of in the locale's encoding. It honors a byte order mark or a PEP 263 coding declaration, and otherwise reads the script as UTF-8. On a locale whose encoding is not UTF-8, a UTF-8 script with non-ASCII text used to fail with UnicodeDecodeError or run with garbled strings. A script which cannot be decoded is now reported as an error reading the script file.
      • A script saved in another encoding, such as the locale's, now needs a coding declaration like # -*- coding: cp949 -*-, as it does when Python runs it.
    • A window title set from another thread with set_window_title() no longer interleaves with the drawing of a prompt-toolkit application which a command runs itself, such as prompt_toolkit.prompt() or the prompt of the ipy command. The title is now written on that application's event loop, as it already was for cmd2's own prompts. This applies when the application shares this app's terminal output and runs in the AppSession which was current when the Cmd was created.
    • The save_help_text.py example script now writes its output file as UTF-8. On a locale whose encoding is not UTF-8, it could fail with UnicodeEncodeError on a character in the help text which that encoding lacks.

New Contributors

Full Changelog: 4.4.3...4.4.4

4.4.3 (2026-11-16)

Choose a tag to compare

@tleonhardt tleonhardt released this 17 Nov 03:14

What's Changed

  • Bug Fixes
    • ppaged() now prints its output when the configured pager program cannot be run, for example where less is not installed. Previously only the shell's error was shown and the output was lost. A pager command which could not be run is not tried again while the application is running, so the shell's error is shown once for each pager command instead of every time.
    • A command which prints through a cmd2 console of its own, such as a Cmd2GeneralConsole showing a Rich progress bar, no longer ends with a BrokenPipeError message when its output is piped to something that exits early, as head does. cmd2 now ends the command quietly instead, printing broken_pipe_warning if it is set. cmd2 consoles now raise ConsoleBrokenPipeError, a new subclass of BrokenPipeError whose file attribute is the stream which broke.
    • Fixed tab completion of file paths and shell commands, and get_exes_in_path(), for names containing square brackets. This includes a working directory, home directory, or PATH directory with brackets in its name.
    • File path completion, shell command completion, and get_exes_in_path() now match * and ? literally instead of returning nothing when the text being completed contains one, so names containing those characters can be completed.
    • Tab completion now quotes a match which has a character that is special to a shell, such as *, ?, (, &, or $, when the text being completed is passed to a shell: the arguments of the shell command and everything after a pipe. This keeps the shell from expanding or misreading the completed name. Everywhere else, only a match with a space is quoted, as before. See the Special Characters in Paths documentation for details.
    • get_exes_in_path(), find_editor(), and shell command completion no longer skip PATH entries which are symbolic links to directories.
    • find_editor() now finds the edit editor on Windows. It was the preferred default editor there but could never be found because it was searched for without its .exe extension, so the default editor on a Windows machine which has edit changes to it.
  • Enhancements
    • Added the rich_progress.py example, which shows how to display the progress of long-running commands with Rich status spinners and progress bars. See the new Updating Output in Place documentation for details, including why a carriage return embedded in a string passed to poutput() does not move the cursor.
    • Added the textual_tty_toolbar.py example, which shows how to keep a bottom toolbar on the screen while commands run by running a cmd2 application inside a Textual application which draws the toolbar. See Embedding in Textual for how it works and what it costs.

New Contributors

Full Changelog: 4.4.2...4.4.3

4.4.2 (November 11, 2026)

Choose a tag to compare

@tleonhardt tleonhardt released this 11 Nov 15:54

What's Changed

  • Security
    • Fixed shell command injection through file names in the edit command and Cmd.run_editor().
      A file name containing shell syntax such as $(...) or backticks was interpreted by the shell
      instead of being passed to the editor as-is. On Windows, run_editor() now raises
      ValueError for an editor or file path containing a double quote, which cannot be passed
      safely to cmd.exe.
    • The persistent history file is now readable and writable only by its owner (mode 0600 on
      POSIX), since history can contain secrets typed as command arguments. The permissions of an
      existing history file are tightened the next time history is saved.

4.4.1 (November 2, 2026)

Choose a tag to compare

@tleonhardt tleonhardt released this 03 Nov 01:35

Overview

There are no functional changes from the 4.4.0 release. The main point is to begin publishing full provenance data to PyPI with each release as an added security feature.

What's Changed

  • Size the relay test's payload from the pipe capacity by @setarcos in #1801
  • Publish releases from GitHub Actions with PyPI provenance by @tleonhardt in #1802

New Contributors

Full Changelog: 4.4.0...4.4.1

4.4.0 (October 31, 2026) 🎃

Choose a tag to compare

@tleonhardt tleonhardt released this 31 Oct 20:18

Overview

This release mostly fixes some edge cases in the build-in history command.

What's Changed

New Contributors

Full Changelog: 4.3.1...4.4.0

4.3.1 (October 24, 2026)

Choose a tag to compare

@tleonhardt tleonhardt released this 24 Oct 20:41

What's Changed

  • Bump github/codeql-action from 4.38.2 to 4.38.3 by @dependabot[bot] in #1772
  • Fix type-check failures with ty 0.0.87 by @DG-Elom in #1774
  • Exclude .DS_Store from release by @traylenator in #1775
  • Route annotated command help through the application output stream by @AryanRG in #1779
  • Bump github/codeql-action from 4.38.3 to 4.39.0 by @dependabot[bot] in #1780
  • Add example embedding a cmd2 app in a Textual app with textual-tty by @DG-Elom in #1773
  • Add example embedding a cmd2 app in a Textual app with textual-tty by @tleonhardt in #1781

New Contributors

Full Changelog: 4.3.0...4.3.1

4.3.0 (October 13, 2026)

Choose a tag to compare

@tleonhardt tleonhardt released this 13 Oct 04:26

Overview

This release primarily fixes a number of subtle bugs related to piping cmd2 command output to shell commands. It also removes the experimental tag from the @with_annotated decorator feature.

Details

  • Stabilized features
    • @with_annotated is no longer experimental. It was introduced as an experimental feature in
      4.0.0 and is now a fully supported way to define a command's arguments, alongside
      @with_argparser. This covers the decorator and its supporting API in cmd2.annotated,
      including Argument, Option, Group, and ArgumentBlock.
      Annotated Argument Processing.
  • Bug Fixes
    • On POSIX, piping a command's output to an interactive program such as less
      (help -v | less) now runs that program as the terminal's foreground job, as a shell pipeline
      does. It had run in a separate session that never received the terminal, so Ctrl-Z and fg
      did not suspend and resume it together with cmd2. The program now owns the terminal as it
      starts, so a pager can set its terminal modes, and Ctrl-C and Ctrl-Z reach the whole pipeline.
      Pipes started from a worker thread, or whose output does not go to the terminal, such as one
      nested in a command whose own output is piped, still run in their own session
    • A shell command piped to an interactive program, such as shell git log | less, now joins
      the pipeline's job, so both processes receive Ctrl-C and Ctrl-Z
    • On Windows, fixed piped output appearing garbled in console programs such as more
      (help -v | more), a regression in 4.2.4. Pipes are written as UTF-8, but console programs
      decode their input with the console's code page. While a pipe or the pager runs, cmd2 now sets
      the console to UTF-8 (code page 65001, as chcp 65001 does) and restores its code pages
      afterward, so console programs and UTF-8 tools such as rg both read the output correctly
    • When copying a command's output to the clipboard (help >) fails, later commands' output is
      no longer written to the temporary file that held it
    • When a pipe's process cannot be started, for instance because no more processes can be created
      or $SHELL names a program that cannot run, both ends of the pipe are now closed rather than
      left open
    • When a pipe's process exits before the command runs, what it wrote, such as the shell's
      "command not found", is no longer lost when cmd2 captures the output, as in a pyscript

4.2.4 (September 8, 2026)

Choose a tag to compare

@tleonhardt tleonhardt released this 08 Sep 21:11

What's Changed

  • uv run does its own sync of the project env with default groups by @tleonhardt in #1746
  • Add aggregation jobs to maxtrix workflows by @tleonhardt in #1747
  • Keep the right prompt out of the committed prompt frame by @tleonhardt in #1749
  • Write redirected and piped output as UTF-8, and stop the suite inheriting colour settings by @tleonhardt in #1753
  • Fix ty errors present in version 0.0.79 which came out yesterday by @tleonhardt in #1754

Full Changelog: 4.2.3...4.2.4

4.2.3 (September 2, 2026)

Choose a tag to compare

@tleonhardt tleonhardt released this 02 Sep 20:43

What's Changed

Full Changelog: 4.2.2...4.2.3

4.2.2 (August 25, 2026)

Choose a tag to compare

@tleonhardt tleonhardt released this 25 Aug 23:10
5dcbcbe
  • Documentation Improvements
    • Improved documentation in attempt at making some recommended best-practices more discoverable
    • Fixed the broken cmd_as_argument example