@ai-ecoverse/slicc-kernel 1.48.0 → 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 = [];
@@ -9605,6 +9609,7 @@ var WasmProcess = class {
9605
9609
  fdInfo(fd) {
9606
9610
  const file = this.fds.get(fd).file;
9607
9611
  const flags = this.fds.statusFlags(fd);
9612
+ const terminal = (file.tty ?? file.pty?.slave)?.name;
9608
9613
  return {
9609
9614
  tty: file.tty !== void 0,
9610
9615
  kind: file instanceof KernelSocket ? "socket" : kernelFdKind(file),
@@ -9613,7 +9618,8 @@ var WasmProcess = class {
9613
9618
  ...this.fds.closesOnExec(fd) ? { cloexec: true } : {},
9614
9619
  ...file.read && !file.write ? { access: "read" } : {},
9615
9620
  ...file.write && !file.read ? { access: "write" } : {},
9616
- ...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 } : {}
9617
9623
  };
9618
9624
  }
9619
9625
  ttySyscall(req) {
@@ -9623,7 +9629,7 @@ var WasmProcess = class {
9623
9629
  case "tty-get":
9624
9630
  return { ok: true, kind: "json", json: tty.tcgets() };
9625
9631
  case "tty-set":
9626
- tty.tcsets(req.termios);
9632
+ tty.tcsets(req.termios, req.flush === true);
9627
9633
  return { ok: true, kind: "void" };
9628
9634
  case "tty-winsz":
9629
9635
  return { ok: true, kind: "json", json: tty.winsize() };