@ai-ecoverse/slicc-kernel 1.47.3 → 1.48.1

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.
package/dist/node.js CHANGED
@@ -7814,9 +7814,13 @@ var KernelTty = class {
7814
7814
  tcgets() {
7815
7815
  return { ...this.termios, c_cc: [...this.termios.c_cc] };
7816
7816
  }
7817
- tcsets(termios) {
7817
+ tcsets(termios, flush = false) {
7818
7818
  const wasCanonical = this.canonical;
7819
7819
  this.termios = { ...termios, c_cc: [...termios.c_cc] };
7820
+ if (flush) {
7821
+ this.line = [];
7822
+ this.readable = [];
7823
+ }
7820
7824
  if (wasCanonical && !this.canonical && this.line.length > 0) {
7821
7825
  this.readable.push(Uint8Array.from(this.line));
7822
7826
  this.line = [];
@@ -9249,6 +9253,7 @@ var WasmProcess = class {
9249
9253
  }
9250
9254
  signal(sig) {
9251
9255
  if (this.execChild !== void 0) {
9256
+ if (sig === SIG.CONT) this.cont();
9252
9257
  void Promise.resolve(this.options.kill?.(this.execChild, sig)).catch(() => void 0);
9253
9258
  if (sig !== SIG.KILL) return "forward";
9254
9259
  if (!this.options.writesBack?.(this.execChild)) return "terminate";
@@ -9604,6 +9609,7 @@ var WasmProcess = class {
9604
9609
  fdInfo(fd) {
9605
9610
  const file = this.fds.get(fd).file;
9606
9611
  const flags = this.fds.statusFlags(fd);
9612
+ const terminal = (file.tty ?? file.pty?.slave)?.name;
9607
9613
  return {
9608
9614
  tty: file.tty !== void 0,
9609
9615
  kind: file instanceof KernelSocket ? "socket" : kernelFdKind(file),
@@ -9612,7 +9618,8 @@ var WasmProcess = class {
9612
9618
  ...this.fds.closesOnExec(fd) ? { cloexec: true } : {},
9613
9619
  ...file.read && !file.write ? { access: "read" } : {},
9614
9620
  ...file.write && !file.read ? { access: "write" } : {},
9615
- ...file.tty?.name ? { name: file.tty.name } : file.pty ? { name: "/dev/ptmx" } : {}
9621
+ ...file.tty?.name ? { name: file.tty.name } : file.pty ? { name: "/dev/ptmx" } : {},
9622
+ ...terminal ? { terminal } : {}
9616
9623
  };
9617
9624
  }
9618
9625
  ttySyscall(req) {
@@ -9622,7 +9629,7 @@ var WasmProcess = class {
9622
9629
  case "tty-get":
9623
9630
  return { ok: true, kind: "json", json: tty.tcgets() };
9624
9631
  case "tty-set":
9625
- tty.tcsets(req.termios);
9632
+ tty.tcsets(req.termios, req.flush === true);
9626
9633
  return { ok: true, kind: "void" };
9627
9634
  case "tty-winsz":
9628
9635
  return { ok: true, kind: "json", json: tty.winsize() };