Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

2.1 KB
Raw Blame
# Note: if you are viewing this from the tap repo, this file is automatically
# updated from:
# https://github.com/RoversX/thinkterm/blob/main/ci/wezterm-homebrew-macos.rb.template
# by automation in the thinkterm repo.
# vim:ft=ruby:
cask "thinkterm" do
  version "@TAG@"

  # One archive per Mac rather than a universal binary: folding both in would
  # double a 66MB download for everyone to spare the smaller half of the
  # audience a choice.
  #
  # No v anywhere -- the tag, the asset names and this version are all the same
  # bare string, because deb and rpm version fields reject a v and Homebrew
  # expects a bare version.
  on_arm do
    sha256 "@SHA256_ARM64@"
    url "https://github.com/RoversX/thinkterm/releases/download/#{version}/ThinkTerm-macos-arm64-#{version}.zip"
  end

  on_intel do
    sha256 "@SHA256_X86_64@"
    url "https://github.com/RoversX/thinkterm/releases/download/#{version}/ThinkTerm-macos-x86_64-#{version}.zip"
  end

  name "ThinkTerm"
  desc "A workspace-first terminal"
  homepage "https://github.com/RoversX/thinkterm"

  conflicts_with cask: [
    "wezterm/wezterm/wezterm",
    "wezterm/wezterm/wezterm-nightly",
  ]

  # Unclear what the minimal OS version is
  # depends_on macos: ">= :sierra"

  app "ThinkTerm.app"
  [
    "thinkterm",
    "wezterm",
    "thinkterm-gui",
    "thinkterm-mux-server",
    "strip-ansi-escapes"
  ].each do |tool|
    binary "#{appdir}/ThinkTerm.app/Contents/MacOS/#{tool}"
  end

  preflight do
    # Move "ThinkTerm-macos-#{version}/ThinkTerm.app" out of the subfolder
    staged_subfolder = staged_path.glob(["ThinkTerm-*", "thinkterm-*"]).first
    if staged_subfolder
      FileUtils.mv(staged_subfolder/"ThinkTerm.app", staged_path)
      FileUtils.rm_rf(staged_subfolder)
    end
  end

  zap trash: [
    "~/Library/Saved Application State/com.roversx.thinkterm.savedState",
  ]

  def caveats; <<~EOS
    Cask #{token} related executables like 'thinkterm', 'wezterm',
    'thinkterm-gui', and 'thinkterm-mux-server' are linked into
      /usr/local/bin/    for x86 Mac,
      /opt/homebrew/bin/ for M1 Mac.

    Removal of them is ensured by 'brew uninstall --cask #{token}'.
  EOS
  end
end