Terminal Effect

class bruhanimate.bruheffect.terminal_effect.TerminalEffect(buffer: Buffer, background: str = ' ')[source]

A pipe-based command console; Player owns pacing and input polling.

This is a line-oriented shell, not a PTY or terminal escape interpreter. Construction opens no processes. Pass handle_event to Player explicitly.

__init__(buffer: Buffer, background: str = ' ')[source]

Base class for all effects.

Parameters:
  • buffer (Buffer) – Effect buffer to push updates to.

  • background (str) – character or string to use for the background.

  • seed – Non-negative integer for independent Python and NumPy random streams. None uses fresh entropy. Global RNG state is untouched.

_enqueue_output(out, output_queue)[source]

Thread worker to read output character by character.

execute_command()[source]

Starts a command or sends input to an active process.

update_history_from_queue()[source]

Assembles lines from characters in the queue.

update(dt: float) → None[source]

Advance simulation by one tick; dt is the tick duration in seconds.

handle_event(event: int) → bool[source]
_close_process()[source]

Reap owned processes and readers; never silently abandon live workers.

close()[source]

Release resources through stop(); safe before start and on repeats.

resize(size: tuple[int, int]) → None[source]

Repaint output/input without draining the queue or resizing a process.