• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 8462
87%

Build:
DEFAULT BRANCH: main
Ran 19 Nov 2026 08:56AM UTC
Jobs 1
Files 697
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Nov 2026 08:54AM UTC coverage: 88.224% (-0.009%) from 88.233%
8462

push

github

web-flow
add `@tty` to async (#4520)

* add `@tty` to async

Port `moonbitlang/async`'s `@tty` (as of async 995380ec) on top of the
runtime's `tty.c` (`moonbit_rt_tty_*`):

- `@event_loop.Tty` reads the terminal through the event bus on Unix, and
  console input records through the thread pool on Windows, converted to
  UTF-8. `SIGWINCH` is recorded as a pending resize instead of cancelling
  the program; `block_resize` defers it like a blocked signal.
- `@tty.Tty` opens the controlling terminal, gets and sets its state
  (`State::make_raw`) and reports the window size. It implements
  `@io.BinaryReader` and `@io.BinaryWriter`; `read_event` also reports
  resizes.

Native only for now. Wasm support needs the host (moonrun) to provide the
`tty/*` imports and `thread_pool/make_read_console_input_job`.

* add ttyd end-to-end tests for `@tty`

* simplify `@tty` reads and imports

* replace `@tty.Tty::read_event` with `raise_on_resize` on reads

Reads of `Tty` raise `TtyError::Resized` with `raise_on_resize=true`
instead of returning `Event::Resize` from a separate `read_event`.
They are wrapped instead of promoted from `@io.BinaryReader`, so
`read_exactly` and `drop_exactly` keep input on resize or cancellation,
and `read_all` / `drop_all` are no longer methods of `Tty`.

* pass `parent` to `@event_loop.open` in `@tty`

* refactor(tty): return resize notifications through MaybeResized

* refactor(tty): manage raw mode and restore terminal state on exit

* feat(tty): add scoped reader API

Replace direct Tty read methods with with_reader callbacks and defer resize delivery once input is ready. Track the active Reader on Tty, reject expired or overlapping reader access, and update the PTY tests and documentation.

* refactor(tty): handle resize around direct input reads

Replace with_reader with a zero-argument handle_resize callback and expose Tty read methods through a private BinaryReader implementation. Consolidate reading into tty.mbt, model scope and read acti... (continued)

1 of 5 new or added lines in 2 files covered. (20.0%)

25742 of 29178 relevant lines covered (88.22%)

770701.4 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
59.89
-0.68% async/internal/event_loop/event_loop.mbt
1
47.06
0.18% async/internal/event_loop/signal.mbt
Jobs
ID Job ID Ran Files Coverage
1 8462.1 19 Nov 2026 08:56AM UTC 697
88.22
GitHub Action Run
Source Files on build 8462
  • Tree
  • List 697
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • fa2d61f8 on github
  • Prev Build on main (#8460)
  • Next Build on main (#8465)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc