Module: reefvision.widgets.terminal
Source: ./reefvision/widgets/terminal.reef
Overview
reefvision.widgets.terminal — PTY View over sys.pty + reefvision.vt
object Terminal extends view.View. Keys (including Esc) become bytes on the master and return event_handled so Window does not promote Esc to CMD_CLOSE. Mouse 1000/1002 is encoded via vt_encode_mouse when the child enabled tracking.
Frame-integrated vertical scrollbar (TextArea convention): paints on the window right-border column via scrollbar.draw_frame_scrollbar when scrollback exists and not alt-screen. Click/drag sets vt.view_off.
Objects
Terminal
Extends: view.View
Fields:
| Name | Type |
|---|---|
pty |
pty.Pty |
vt |
vt.Vt |
child_pid |
int |
is_sb_dragging |
bool |
proc init(bounds: cell.Rect)
Methods:
exclusive fn spawn_shell(program: string, argv: [string]): bool
exclusive fn child_alive(): bool
exclusive proc set_scrollback(cap: int)
exclusive fn scrollback(): int
override shared fn wants_focus(): bool
override shared fn captures_mouse(): bool
override shared fn hit_bounds(): cell.Rect
Right window-frame column holds the scroll thumb (TextArea convention).
shared fn has_scrollbar(): bool
Scrollback rows past the live viewport (primary buffer only).
exclusive fn sb_content_len(): int
ListBox/TextArea offset: 0 = top of history. VT view_off: 0 = live bottom.
exclusive fn sb_paint_offset(): int
exclusive proc set_view_from_y(abs_bounds: cell.Rect, y: int)
exclusive fn handle_scrollbar_mouse(e: event.Event): bool
override shared fn poll_fd(): int
override exclusive fn drain_poll(): bool
override exclusive proc yield_pause()
override exclusive proc yield_resume()
exclusive proc apply_winsize(w: int, h: int)
exclusive proc set_winsize_from_bounds()
exclusive proc write_pty(data: string)
exclusive proc shutdown()
override exclusive proc draw(buf: cell.CellBuffer, abs: cell.Rect, clip: cell.Rect, focused: bool, th: theme.Theme)
override exclusive fn handle_event(e: event.Event): view.EventResult
Functions
fn empty_pty(): pty.Pty
fn utf8_of_cp(cp: int): string
fn fkey_seq(n: int): string
fn encode_key(ke: event.KeyEvent): string
fn mouse_pb(btn: event.MouseButton): option.Option[int]
Generated by reefc doc