textual-terminal


Nametextual-terminal JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/mitosch/textual-terminal
SummaryA terminal emulator widget for Textual.
upload_time2023-01-29 14:19:12
maintainer
docs_urlNone
authorMischa Schindowski
requires_python>=3.7,<4.0
licenseLGPL-3.0-or-later
keywords textual textual terminal textual terminal emulator textual subprocess
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Textual: Terminal

A terminal widget for [Textual](https://github.com/Textualize/textual) using
[Pyte](https://github.com/selectel/pyte) as a linux terminal emulator.

<details><summary>Textual application example with two terminal widgets:</summary>

![textual_terminal_example](https://user-images.githubusercontent.com/922559/214794889-4d376da1-6aa9-4576-a01d-0beee2536e41.png)

</details>

## Usage

```python
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

```bash
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`:

```python
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](https://github.com/selectel/pyte/blob/master/examples/terminal_emulator.py)
by [David Brochart](https://github.com/davidbrochart).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mitosch/textual-terminal",
    "name": "textual-terminal",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "textual,textual terminal,textual terminal emulator,textual subprocess",
    "author": "Mischa Schindowski",
    "author_email": "mschindowski@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bb/fe/94e6a50d388c9c8ce0da27f71ca5abecd99a15d4347b3d6dccc1dedfe76f/textual_terminal-0.3.0.tar.gz",
    "platform": null,
    "description": "# Textual: Terminal\n\nA terminal widget for [Textual](https://github.com/Textualize/textual) using\n[Pyte](https://github.com/selectel/pyte) as a linux terminal emulator.\n\n<details><summary>Textual application example with two terminal widgets:</summary>\n\n![textual_terminal_example](https://user-images.githubusercontent.com/922559/214794889-4d376da1-6aa9-4576-a01d-0beee2536e41.png)\n\n</details>\n\n## Usage\n\n```python\nfrom textual_terminal import Terminal\n\nclass TerminalApp(App):\n    def compose(self) -> ComposeResult:\n        yield Terminal(command=\"htop\", id=\"terminal_htop\")\n        yield Terminal(command=\"bash\", id=\"terminal_bash\")\n\n    def on_ready(self) -> None:\n        terminal_htop: Terminal = self.query_one(\"#terminal_htop\")\n        terminal_htop.start()\n\n        terminal_bash: Terminal = self.query_one(\"#terminal_bash\")\n        terminal_bash.start()\n```\n\n## Installation\n\n```bash\npip install textual-terminal\n```\n\n## Features\n\n* Colored output\n* Automatic resize to widget dimensions\n* Simple key handling (navigation, function keys)\n* Simple mouse tracking (click, scroll)\n\n## Options\n\n### `default_colors`\n\nBy default, textual-terminal uses the colors defined by the system (not the\nTextual colors). To use the Textual background and foreground colors for\n\"default\" ANSI colors, set the option `default_colors` to `textual`:\n\n```python\nTerminal(command=\"htop\", default_colors=\"textual\")\n```\n\nNote: This only applies to ANSI colors without an explicit setting, e.g. if the\nbackground is set to \"red\" by an application, it will stay red and the option\nwill not have any effect.\n\n## References\n\nThis library is based on the\n[Textual pyte example](https://github.com/selectel/pyte/blob/master/examples/terminal_emulator.py)\nby [David Brochart](https://github.com/davidbrochart).\n",
    "bugtrack_url": null,
    "license": "LGPL-3.0-or-later",
    "summary": "A terminal emulator widget for Textual.",
    "version": "0.3.0",
    "split_keywords": [
        "textual",
        "textual terminal",
        "textual terminal emulator",
        "textual subprocess"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab3dc9202997d383a317b14de28e2c7925b56a83edb0a74012ee39b86217850f",
                "md5": "e091bd3c21e45f58308a7e211eeac486",
                "sha256": "f00b22f5a59ef6d60b61453d7a98354647487c00342d4b0324221db18c4a90f1"
            },
            "downloads": -1,
            "filename": "textual_terminal-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e091bd3c21e45f58308a7e211eeac486",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 12529,
            "upload_time": "2023-01-29T14:19:11",
            "upload_time_iso_8601": "2023-01-29T14:19:11.006399Z",
            "url": "https://files.pythonhosted.org/packages/ab/3d/c9202997d383a317b14de28e2c7925b56a83edb0a74012ee39b86217850f/textual_terminal-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bbfe94e6a50d388c9c8ce0da27f71ca5abecd99a15d4347b3d6dccc1dedfe76f",
                "md5": "4acfd58da254b462f66ac43231f2de02",
                "sha256": "594e7323b74d1e395cf3ce39216cef78cb7c64d01ea71a60ea7b0f9b198e4c87"
            },
            "downloads": -1,
            "filename": "textual_terminal-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4acfd58da254b462f66ac43231f2de02",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 9482,
            "upload_time": "2023-01-29T14:19:12",
            "upload_time_iso_8601": "2023-01-29T14:19:12.464273Z",
            "url": "https://files.pythonhosted.org/packages/bb/fe/94e6a50d388c9c8ce0da27f71ca5abecd99a15d4347b3d6dccc1dedfe76f/textual_terminal-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-29 14:19:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "mitosch",
    "github_project": "textual-terminal",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "textual-terminal"
}
        
Elapsed time: 0.04221s