Move terminal emulator to daScript#3513
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the dasTerminal terminal emulator (parsing, state, snapshots, key/paste encoding, and viewport projection) from C++ into daScript, leaving native code as a minimal PTY/process transport layer. It replaces the prior C++ semantic test coverage with daScript tests and adds benchmarks around feed throughput and snapshot scaling.
Changes:
- Remove the C++ terminal emulator implementation and expose only PTY transport primitives from native code.
- Implement the terminal emulator, snapshots, and input encoding in
modules/dasTerminal/daslib/terminal.das, with new daScript semantic tests. - Adjust tests/benchmarks/docs to reflect the new raw-byte transport boundary and daScript-centric validation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests-cpp/small/test_terminal.cpp | Reduces C++ coverage to a PTY transport-only ConPTY integration test, now matching raw-byte behavior. |
| modules/dasTerminal/tests/terminal_semantics.das | Adds daScript semantic coverage for parsing/snapshots/chunk invariance/replies/events/key+paste encoding. |
| modules/dasTerminal/tests/snapshot_smoke.das | Updates smoke test expectations around disposal semantics. |
| modules/dasTerminal/src/terminal.h | Removes the C++ terminal emulator API/types (deleted). |
| modules/dasTerminal/src/terminal.cpp | Removes the C++ terminal emulator implementation (deleted). |
| modules/dasTerminal/src/dasTerminal.cpp | Refactors native bindings to expose PTY-only APIs and a pty_handle managed type. |
| modules/dasTerminal/src/aot_builtin_terminal.h | Replaces TerminalHandle with PtyHandle and updates exported native entrypoints. |
| modules/dasTerminal/README.md | Updates module documentation to describe daScript emulator + native PTY boundary and new test/benchmark locations. |
| modules/dasTerminal/daslib/terminal.das | Introduces the daScript terminal emulator core, snapshots/viewports, and raw-byte reply/event plumbing. |
| modules/dasTerminal/CMakeLists.txt | Removes C++ terminal sources, installs only PTY headers, and registers the new daScript semantic test. |
| benchmarks/terminal/snapshot_scaling.das | Adds a feed-throughput benchmark alongside existing snapshot scaling benchmarks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
borisbat
force-pushed
the
codex/das-terminal-daslang
branch
from
July 19, 2026 22:35
08fb7fa to
e7971e3
Compare
borisbat
force-pushed
the
codex/das-terminal-daslang
branch
from
July 19, 2026 22:54
e7971e3 to
5d2ec3e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
array<uint8>feed/write/reply paths while retaining compatibility string boundariesPerformance
For a 154 KB / 2,000-line feed workload:
The feed benchmark includes terminal creation, parsing, scrollback allocation, and disposal. Viewport projection is cached by terminal revision and scroll offset, so it is rebuilt on updates rather than for idle frames.
Validation
modules/dasTerminal/tests/snapshot_smoke.dasmodules/dasTerminal/tests/terminal_semantics.dastests-cpp-smallCompanion UI adaptation: borisbat/dasImgui#228
Deliberately deferred oracle phase
This PR does not select or embed a C++ terminal library. The follow-up sequence is: