Tmux

NAME

Samaki::Plugin::Tmux -- Base class for tmux-based interactive plugins

SYNOPSIS

# Create a subclass for a specific command
use Samaki::Plugin::Tmux;

unit class Samaki::Plugin::Tmux::MyCommand is Samaki::Plugin::Tmux;

method name { "tmux-mycommand" }
method description { "Run mycommand in a tmux pane" }
has $.command = 'mycommand';

DESCRIPTION

This role provides a base class for plugins that interact with commands running in tmux windows. Unlike the Samaki::Plugin::Repl plugins which use a PTY to capture output, this plugin uses tmux's control mode protocol to:

  • Create new tmux windows for running commands

  • Stream output from windows in real-time via %output notifications

  • Send input to windows using tmux send-keys

  • Maintain persistent sessions across cell executions

Key Features

  • Real tmux windows - Each command runs in its own tmux window, visible in your tmux session and accessible via normal tmux window switching (C-b n/p).

  • Multiple simultaneous sessions - Different plugin instances maintain separate windows, allowing multiple independent sessions.

  • Control mode streaming - Output is streamed via tmux's control mode protocol, providing real-time updates without polling.

REQUIREMENTS

The user must be running samaki from within a tmux session. The plugin will error if the TMUX environment variable is not set.

OPTIONS

  • delay -- Seconds to wait between sending lines (default: 0.1)

  • name -- Name of the tmux window to use. By default each cell creates a new tmux window. When name is set, all cells with the same name share a single tmux window (creating it on first use).

SEE ALSO

Samaki::Plugin::Repl - Alternative approach using PTY Samaki::Plugin::Tmux::Bash - Bash shell example Samaki::Plugin::Tmux::Python - Python interpreter example

App::samaki v0.0.33

Simple Arrangements of Modules with Any Kind of Items

Authors

  • Brian Duggan

License

MIT

Dependencies

LLM::DWIMLog::AsyncTerminal::UI:ver<0.1.13>ColorDuckie:ver<0.0.12>Prettier::TableTime::DurationTerminal::ANSIDuck::CSVColorCodeUnitMarkdown::GrammarTerminal::WCWidthHTTP::TinyTimezone::Simple

Test Dependencies

Provides

  • Samaki
  • Samaki::Cell
  • Samaki::Conf
  • Samaki::Events
  • Samaki::Exporter::HTML
  • Samaki::Importer::Jupyter
  • Samaki::Page
  • Samaki::Plugin
  • Samaki::Plugin::Auto
  • Samaki::Plugin::Bash
  • Samaki::Plugin::Code
  • Samaki::Plugin::Duck
  • Samaki::Plugin::Duckie
  • Samaki::Plugin::File
  • Samaki::Plugin::HTML
  • Samaki::Plugin::LLM
  • Samaki::Plugin::Markdown
  • Samaki::Plugin::Postgres
  • Samaki::Plugin::Process
  • Samaki::Plugin::Raku
  • Samaki::Plugin::Repl
  • Samaki::Plugin::Repl::Python
  • Samaki::Plugin::Repl::R
  • Samaki::Plugin::Repl::Raku
  • Samaki::Plugin::Text
  • Samaki::Plugin::Tmux
  • Samaki::Plugin::Tmux::Bash
  • Samaki::Plugin::Tmux::Python
  • Samaki::Plugin::URL
  • Samaki::Plugins
  • Samaki::Plugout
  • Samaki::Plugout::CSVGeo
  • Samaki::Plugout::ChartJS
  • Samaki::Plugout::Common
  • Samaki::Plugout::D3
  • Samaki::Plugout::DataTable
  • Samaki::Plugout::DeckGLBin
  • Samaki::Plugout::Duckview
  • Samaki::Plugout::Geojson
  • Samaki::Plugout::HTML
  • Samaki::Plugout::JSON
  • Samaki::Plugout::Plain
  • Samaki::Plugout::Raw
  • Samaki::Plugout::TJLess
  • Samaki::Plugouts
  • Samaki::Utils
  • Samaki::Watcher
  • sam

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.