#!/usr/bin/env BQN
# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2023 Rampoina <rampoina@protonmail.com>

ansi⇐{
  e⇐@+27
  red⇐e∾"[31m"
  cyan⇐e∾"[36m"
  yellow⇐e∾"[33m"
  defaultB⇐e∾"[0m"
  cursor⇐{
    hide⇐e∾"[?25l"
    show⇐e∾"[?25h"
    origin⇐e∾"[H"
  }
  clear⇐{
    screen⇐e∾"[2J"
  }
  reset⇐e∾"[0m"

  InitTerm⇐{𝕤
    •term.RawMode 1
    •Out ansi.cursor.hide∾ansi.clear.screen∾ansi.cursor.origin
  }

  RestoreTerm⇐{𝕤⋄•Out ansi.reset∾ansi.cursor.show}
}
