import { useState, useEffect } from "react";
function useTerminalSize() {
  const [size, setSize] = useState({
    columns: process.stdout.columns || 80,
    rows: process.stdout.rows || 24
  });
  useEffect(() => {
    function updateSize() {
      setSize({
        columns: process.stdout.columns || 80,
        rows: process.stdout.rows || 24
      });
    }
    process.stdout.on("resize", updateSize);
    updateSize();
    return () => {
      process.stdout.off("resize", updateSize);
    };
  }, []);
  return size;
}
export {
  useTerminalSize
};
