Repository navigation
What's Changed
- Bug Fixes
ppaged()now prints its output when the configured pager program cannot be run, for example wherelessis 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
cmd2console of its own, such as aCmd2GeneralConsoleshowing a Rich progress bar, no longer ends with aBrokenPipeErrormessage when its output is piped to something that exits early, asheaddoes.cmd2now ends the command quietly instead, printingbroken_pipe_warningif it is set.cmd2consoles now raiseConsoleBrokenPipeError, a new subclass ofBrokenPipeErrorwhosefileattribute 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, orPATHdirectory 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 theshellcommand 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 skipPATHentries which are symbolic links to directories.find_editor()now finds theediteditor on Windows. It was the preferred default editor there but could never be found because it was searched for without its.exeextension, so the default editor on a Windows machine which haseditchanges 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
cmd2application inside a Textual application which draws the toolbar. See Embedding in Textual for how it works and what it costs.
- 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
New Contributors
- @anticipate218 made their first contribution in #1811
Full Changelog: 4.4.2...4.4.3