Skip to main content

A terminal emulator widget for Textual.

Project description

Textual: Terminal

A terminal widget for Textual using Pyte as a linux terminal emulator.

Textual application example with two terminal widgets:

textual_terminal_example

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)

References

This library is based on the Textual pyte example by David Brochart.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textual_terminal-0.2.1.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

textual_terminal-0.2.1-py3-none-any.whl (11.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page