"use strict";

// src/ttyStub.cjs
var tty = require("tty");
var original = tty.isatty;
tty.isatty = (fd) => {
  if (fd === 1 || fd === 2) {
    return true;
  }
  return original(fd);
};
[process.stdout, process.stderr].forEach((stream) => {
  ;
  ["cursorTo", "clearLine", "clearScreenDown", "moveCursor", "hasColors"].forEach((method) => stream[method] = tty.WriteStream.prototype[method]);
  stream.columns = process.env.TTY_STUB_COLS;
  stream.rows = process.env.TTY_STUB_ROWS;
  stream.getColorDepth = () => {
    return process.env.TTY_STUB_COLORS;
  };
  stream.getWindowSize = () => {
    return [stream.columns, stream.rows];
  };
});
process.stdout.isTTY = true;
process.stderr.isTTY = true;
