A shell widget for textual.
Project description
Textual-Shell
Welcome to the Textual-Shell documentation! This is an addon for the Textual framework.
What is Textual-Shell?
It is a collection of widgets that can be used to build a custom shell application. It draws inspiration from the cmd2 and prompt-toolkit libraries.
Quick Start
Install it with:
pip install textual-shell
# app.py
from textual.app import App, ComposeResult
from textual.geometry import Offset
from textual-shell.widgets import Shell, CommandList
from textual-shell.command import Help, Set
class ShellApp(App):
cmd_list = [Help(), Set()] # add your commands here.
command_names = [cmd.name for cmd in cmd_list]
def compose(self) -> ComposeResult:
yield CommandList(self.command_names)
yield Shell(
self.cmd_list,
prompt='shell <$ ',
suggestion_offset=Offset(10, 3)
)
if __name__ == '__main__':
ShellApp().run()
TODO:
- Command line validation
- Command Result
- flesh out command messages
- build settings widget
- write documentation on Commands
- write documentation on shell key binds
- Add command history
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
textual_shell-0.8.0.tar.gz
(10.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textual_shell-0.8.0.tar.gz.
File metadata
- Download URL: textual_shell-0.8.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f235edbf909eab092c7b546270f49f12ce8a4bd539cc424d7a34f4b1998cecea
|
|
| MD5 |
decd2e8e42e3cd58f737411b7ca9b4a5
|
|
| BLAKE2b-256 |
c2de2875dc49fb9a98020ffa45aac951816314941165f3563d27a241285062e9
|
File details
Details for the file textual_shell-0.8.0-py3-none-any.whl.
File metadata
- Download URL: textual_shell-0.8.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07b4bd2cbb6bc0cf1baa6b3f6d17f709ecd131c61b23eedfa6f971ecd510aaf8
|
|
| MD5 |
eba03e9280a6a7a2c0d6fdcd57296c34
|
|
| BLAKE2b-256 |
dd6b17d782c817cbb9afa556d1bad77aa0b5e7061ddc7b3b9b17b2552f273ba9
|