Skip to main content

Native GPU-accelerated Terminal control for Flet using xterm.dart

Project description

flet-terminal

Native GPU-accelerated Terminal control for Flet (ft.LayoutControl) powered by xterm.dart. Exposes a high-throughput, low-latency terminal canvas with zero-copy binary streaming via Flet DataChannels.


🚀 Multi-Platform Demo Studio Downloads

Want to try the live terminal demo, high-speed ring buffer stress tests, and Termux virtual accessory keys before integrating?
Download the pre-built multi-platform binaries right now:

Variant Download Link Notes
📱 ARM64 (most phones) fletterminalstudio-arm64-v8a.apk Modern 64-bit Android devices
📱 ARMv7 (older phones) fletterminalstudio-armeabi-v7a.apk Legacy 32-bit Android devices
💻 x86_64 (emulators) fletterminalstudio-x86_64.apk Chromebooks & Android emulators
🖥️ Windows portable FletTerminalStudio_0.1.0_windows_x64.zip Standalone portable executable (.exe)
🐧 Linux standalone FletTerminalStudio_0.1.0_linux_x86_64.tar.gz Pre-compiled Linux binary bundle
🌐 Web PWA FletTerminalStudio_0.1.0_web_pwa.zip Static Web Assembly / Progressive Web App

📦 Installation

pip install flet-terminal

(Note: Requires Flet >= 0.80.0)


💻 Quick Start & Integration

flet-terminal wraps Flutter's xterm.dart widget in a reusable Flet control (Terminal). Drop it directly into your page layout (Row, Column, Container, or Tabs) just like any other Flet widget:

import flet as ft
from flet_terminal import Terminal


def main(page: ft.Page):
    # 1. Instantiate the Terminal widget
    terminal = Terminal(
        font_size=13.0,
        cursor_style="block",
        cursor_blink=True,
        theme={"background": "#1e1e2e", "foreground": "#cdd6f4"},
    )

    # 2. Handle user keyboard input (send to local PTY, SSH, or serial port)
    def handle_keyboard(e):
        # e.data contains keystrokes typed by the user inside the terminal canvas
        terminal.write(f"You typed: {e.data}\r\n")

    terminal.on_data = handle_keyboard

    # 3. Add to page inside a SafeArea (respects mobile notches and status bars)
    page.add(
        ft.SafeArea(
            ft.Container(
                content=terminal,
                expand=True,
                bgcolor="#1e1e2e",
                border_radius=8,
            )
        )
    )

    # 4. Write VT100/ANSI sequences directly from Python
    terminal.write("\x1b[1;32mWelcome to flet-terminal!\x1b[0m\r\n$ ")


ft.run(main)

✨ Key Features & Mobile Capabilities

  • ⚡ Zero-Copy Binary Streaming (send_bytes): High-throughput Flet DataChannel bridge eliminates base64/JSON encoding overhead, rendering 10,000+ lines in milliseconds without UI stutter.
  • 🎨 Full VT100/ANSI Support: True RGB colors, bold/italic formatting, alternate screen buffers (htop/vim mode), window titles (OSC 0), and bell notifications (\a).
  • 📱 Termux-Style Virtual Accessory Bar: Built-in awareness for mobile soft keyboards (Android/iOS) with tactile virtual accessory keys (ESC, TAB, CTRL+C, , , , , |, /, -, ~, CLR).
  • 🛡️ Safe Area & Responsive Toolbar: Automatically respects OS status bars, camera cutouts, and bottom navigation bars across Desktop, Android, and Web sandboxes.

📄 License

MIT License

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

flet_terminal-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flet_terminal-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file flet_terminal-0.1.0.tar.gz.

File metadata

  • Download URL: flet_terminal-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flet_terminal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b101add0dc35b92e37c091055dedd7430384d9115c58afcd77c81dc4a7c81d47
MD5 86c887d9a68b4f3f377869fc7954d03b
BLAKE2b-256 6a1b3173f5370749bc54d71a64980083290b566f7f54c8e5b33908ba300133e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for flet_terminal-0.1.0.tar.gz:

Publisher: publish.yml on Nwokike/flet-terminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flet_terminal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flet_terminal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flet_terminal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff70729533682c6fa30a7d1c823cd3373ecae0c4649e1ea6c984e0d305e6a46d
MD5 aad2ef07123181f24f0f6844df0a4e1f
BLAKE2b-256 68c694841d8ae6eab7fc065f2b836a8143f8438462b349ef6306c47b60d842db

See more details on using hashes here.

Provenance

The following attestation bundles were made for flet_terminal-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Nwokike/flet-terminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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