Skip to content

Implement BEL control code event emission for decoupled bell handling - #8

Open
Chris-Moller wants to merge 2 commits into
soli-testbench:mainfrom
Chris-Moller:agent-task-8247ca3b
Open

Implement BEL control code event emission for decoupled bell handling#8
Chris-Moller wants to merge 2 commits into
soli-testbench:mainfrom
Chris-Moller:agent-task-8247ca3b

Conversation

@Chris-Moller

Copy link
Copy Markdown
Contributor

Task

Implement BEL control code event emission for decoupled bell handling

Type: feature | Size: small | Priority: undefined

Description

Add BEL (ASCII 0x07) control code handling to the terminal engine that emits a bell event, allowing the UI layer to independently implement audio or visual responses. The parser already recognizes BEL as a C0 control code and routes it through onExecute, and the terminal engine already has a case 0x07: // BEL stub in _execute() that currently does nothing. This feature wires up a callback from that existing stub and optionally adds a visual bell handler in the UI/Renderer layer. This maintains clean separation of concerns between the engine and presentation layers.

Acceptance Criteria

  1. The Terminal class exposes a bell event callback (e.g., onBell) that fires when a BEL (0x07) character is processed in _execute().
  2. The existing case 0x07 stub in src/terminal.js invokes the bell callback/event when triggered.
  3. The UI/Renderer layer includes a default visual bell handler (e.g., a brief CSS flash animation) that responds to the bell event.
  4. The engine does not directly depend on any specific rendering or audio implementation — bell behavior is fully decoupled.
  5. If no bell handler is registered, processing BEL is a no-op (no errors thrown).
  6. A test verifies that parsing input containing 0x07 triggers the bell event callback.

Implementation Summary

Implemented BEL (0x07) control code event emission with onBell callback in Terminal, visual bell CSS animation in Renderer, and two passing tests

Completed:

  • The Terminal class exposes a bell event callback (onBell) that fires when a BEL (0x07) character is processed in _execute()
  • The existing case 0x07 stub in src/terminal.js invokes the bell callback when triggered
  • The UI/Renderer layer includes a default visual bell handler (CSS flash animation) that responds to the bell event
  • The engine does not directly depend on any specific rendering or audio implementation — bell behavior is fully decoupled
  • If no bell handler is registered, processing BEL is a no-op (no errors thrown)
  • A test verifies that parsing input containing 0x07 triggers the bell event callback

Changed files:

  • src/terminal.js
  • src/renderer.js
  • src/mogterm.css
  • test/terminal.test.js

Tests were run and passed.

Commits

  • 06fd7f3 feat(terminal): implement BEL control code event emission
  • 09422a8 chore: add implementation plan

Implemented by Venice Executor · task 8247ca3b-60ae-45b8-aa0b-983d9caec454

Chris-Moller and others added 2 commits March 18, 2026 21:07
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add onBell callback to Terminal that fires when BEL (0x07) is processed,
with a visual bell handler in Renderer using CSS animation. The bell
behavior is fully decoupled from the engine via the nullable callback
pattern used throughout the codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant