omegon 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -492,9 +492,19 @@ function restartOmegon(): never {
492
492
  // (and the user) aren't stuck with raw-mode terminal if something goes wrong.
493
493
  try {
494
494
  // RIS (Reset to Initial State) — the only reliable way to ensure ALL
495
- // terminal protocol state is cleared. Selective escape sequences are
496
- // fragile and miss features we don't know about.
497
- process.stdout.write("\x1bc");
495
+ // terminal protocol state is cleared. Write directly to the TTY fd
496
+ // to bypass pi's TUI layer which intercepts process.stdout and would
497
+ // mangle the escape sequence into visible ANSI garbage.
498
+ const { openSync, writeSync, closeSync } = require("fs") as typeof import("fs");
499
+ let ttyFd = -1;
500
+ try {
501
+ ttyFd = openSync("/dev/tty", "w");
502
+ writeSync(ttyFd, "\x1bc");
503
+ closeSync(ttyFd);
504
+ } catch {
505
+ // Fallback if /dev/tty isn't available (shouldn't happen on macOS/Linux)
506
+ process.stdout.write("\x1bc");
507
+ }
498
508
  // Pause stdin to prevent buffered input from being re-interpreted
499
509
  // after raw mode is disabled (prevents Ctrl+D from closing parent shell).
500
510
  process.stdin.pause();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omegon",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Omegon — an opinionated distribution of pi (by Mario Zechner) with extensions for lifecycle management, memory, orchestration, and visualization",
5
5
  "bin": {
6
6
  "omegon": "bin/omegon.mjs",