class Tryouts::CLI::TTYStatusDisplay

def check_tty_availability

def check_tty_availability
  # Check if we have a real TTY
  return false unless @io.respond_to?(:tty?) && @io.tty?
  # Check if we can get screen dimensions
  return false unless TTY::Screen.width > 0 && TTY::Screen.height > STATUS_LINES + 5
  # Check if TERM environment variable suggests terminal capabilities
  term = ENV.fetch('TERM', nil)
  return false if term.nil? || term == 'dumb'
  # Check if we're likely in a CI environment (common CI env vars)
  ci_vars = %w[CI CONTINUOUS_INTEGRATION BUILD_NUMBER JENKINS_URL GITHUB_ACTIONS]
  return false if ci_vars.any? { |var| ENV[var] }
  true
rescue StandardError => ex
  # If any TTY detection fails, assume not available
  if @show_debug
    @io.puts "TTY detection failed: #{ex.message}"
  end
  false
end