Added a couple simple example for using tmux or byobu to launch cmd2 applications#1399
Merged
tleonhardt merged 5 commits intomasterfrom Dec 29, 2024
Merged
Added a couple simple example for using tmux or byobu to launch cmd2 applications#1399tleonhardt merged 5 commits intomasterfrom
tleonhardt merged 5 commits intomasterfrom
Conversation
…tmux or byobu to launch a cmd2 application in a terminal multiplexer along with another application such as a shell. One example uses windows/tabs and the other uses a split screen mode.
tleonhardt
commented
Dec 28, 2024
|
|
||
| - Tab Completion | ||
| - Automation Transition | ||
| - Tab Completion |
Member
Author
There was a problem hiding this comment.
All whitespace changes like this are due to prettier auto-formatting of Markdown and YAML files accoridng to the configuration in the .prettierrc configuration file in the cmd2 project root directory.
There is a Prettier extension for VSCode and a Prettier plugin for PyCharm - both make it easy to auto-format on save.
In the future we may want to look into a GitHub Actions workflow to check the auto-formatting of all Markdown and YAML files using Prettier, but I think that might be overkill at this time.
kmvanbrunt
requested changes
Dec 28, 2024
Member
kmvanbrunt
left a comment
There was a problem hiding this comment.
A few spelling and grammar errors.
examples/README.md
Outdated
| - [arg_decorators.py](https://github.com/python-cmd2/cmd2/blob/master/examples/arg_decorators.py) | ||
| - Demonstrates how to use the `cmd2.with_argparser` decorator to specify command arguments using [argparse](https://docs.python.org/3/library/argparse.html) | ||
| - [arg_print.py](https://github.com/python-cmd2/cmd2/blob/master/examples/arg_print.py) | ||
| - Demonstrates how arguments and options get parsed and passed to commands and shows how shortcust work |
examples/README.md
Outdated
| - [custom_parser.py](https://github.com/python-cmd2/cmd2/blob/master/examples/custom_parser.py) | ||
| - Demonstrates how to create your own customer `Cmd2ArgumentParser`; used by the `override_parser.py` example | ||
| - [decorator_example.py](https://github.com/python-cmd2/cmd2/blob/master/examples/decorator_example.py) | ||
| - Shows how to use cmd2's various argparse decotrators to processes command-line arguments |
examples/README.md
Outdated
| - [modular_commands_main.py](https://github.com/python-cmd2/cmd2/blob/master/examples/modular_commands_main.py) | ||
| - Complex example demonstrating a variety of methods to load `CommandSets` using a mix of command decorators | ||
| - [modular_subcommands.py](https://github.com/python-cmd2/cmd2/blob/master/examples/modular_subcommands.py) | ||
| - Shows how to use dynamically add and remove subcommands at runtime using `CommandSets` |
examples/README.md
Outdated
| - [pirate.py](https://github.com/python-cmd2/cmd2/blob/master/examples/pirate.py) | ||
| - Demonstrates many features including colorized output, multiline commands, shorcuts, defaulting to shell, etc. | ||
| - [python_scripting.py](https://github.com/python-cmd2/cmd2/blob/master/examples/python_scripting.py) | ||
| - Shows how cmd2's built-in `run_pyscript` command and provide advanced Python scripting of cmd2 applications |
Member
There was a problem hiding this comment.
Fix wording of this sentence.
examples/tmux_split.sh
Outdated
| # If the second isn't provided, then the user's default shell is launched for this. | ||
| # | ||
| # byobu must be installed for this script to work and you can install it using your | ||
| # operating system package manager. or info on how to use Byobu, see: https://www.byobu.org/ |
examples/tmux_launch.sh
Outdated
| # See the tmux Wiki for info on how to use it: https://github.com/tmux/tmux/wiki. | ||
| # To shift focus between different windows in tmux use Ctrl-b followed by l (lowercase "L"). | ||
| # | ||
| # NOTE: IF you have byobu installed, it is a wrapper around tmux and will likely run instead of tmux. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a couple simple example shell scripts demonstrating how to use tmux or [byobu])(https://www.byobu.org/) to launch a
cmd2application in a terminal multiplexer along with another application such as a shell.One example uses windows/tabs and the other uses a split screen mode.
Using a terminal multiplexer to have a
cmd2app running at the same time as a shell within a single physical terminal is a common use case I have seen multiplecmd2customer use. This intent is to make this use case more discoverable for those not very familiar withtmuxorbyobu.Also added a README.md with brief documentation about each example and added that to the built documentation as well.