Textual: Terminal
A terminal widget for Textual using Pyte as a linux terminal emulator.
Textual application example with two terminal widgets:
Usage
from textual_terminal import Terminal
class TerminalApp(App):
def compose(self) -> ComposeResult:
yield Terminal(command="htop", id="terminal_htop")
yield Terminal(command="bash", id="terminal_bash")
def on_ready(self) -> None:
terminal_htop: Terminal = self.query_one("#terminal_htop")
terminal_htop.start()
terminal_bash: Terminal = self.query_one("#terminal_bash")
terminal_bash.start()
Installation
pip install textual-terminal
Features
- Colored output
- Automatic resize to widget dimensions
- Simple key handling (navigation, function keys)
- Simple mouse tracking (click, scroll)
Options
default_colors
By default, textual-terminal uses the colors defined by the system (not the
Textual colors). To use the Textual background and foreground colors for
"default" ANSI colors, set the option default_colors to textual:
Terminal(command="htop", default_colors="textual")
Note: This only applies to ANSI colors without an explicit setting, e.g. if the background is set to "red" by an application, it will stay red and the option will not have any effect.
References
This library is based on the Textual pyte example by David Brochart.
Metadata
Release files for textual-terminal 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| textual_terminal-0.3.0.tar.gz | 9.5 kB | Without provenance | Details for textual_terminal-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| textual_terminal-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for textual_terminal-0.3.0-py3-none-any.whl |
Total release size: 22.0 kB
Release files / textual_terminal-0.3.0.tar.gz
| Download URL | textual_terminal-0.3.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
594e7323b74d1e395cf3ce39216cef78cb7c64d01ea71a60ea7b0f9b198e4c87
|
|
BLAKE2b-256 checksum How to use checksums |
bbfe94e6a50d388c9c8ce0da27f71ca5abecd99a15d4347b3d6dccc1dedfe76f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-58-generic
|
Release files / textual_terminal-0.3.0-py3-none-any.whl
| Download URL | textual_terminal-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f00b22f5a59ef6d60b61453d7a98354647487c00342d4b0324221db18c4a90f1
|
|
BLAKE2b-256 checksum How to use checksums |
ab3dc9202997d383a317b14de28e2c7925b56a83edb0a74012ee39b86217850f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-58-generic
|
Security for textual-terminal 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.