isSupported property

bool get isSupported

Whether the terminal likely supports OSC 8 links.

Implementation

static bool get isSupported {
  final term = io.Platform.environment['TERM'] ?? '';
  final termProgram = io.Platform.environment['TERM_PROGRAM'] ?? '';
  final wtSession = io.Platform.environment['WT_SESSION'];
  final conemu = io.Platform.environment['ConEmuANSI'];

  if (termProgram == 'iTerm.app') return true;
  if (termProgram == 'vscode') return true;
  if (termProgram == 'Hyper') return true;
  if (termProgram == 'WezTerm') return true;
  if (wtSession != null) return true;
  if (conemu == 'ON') return true;
  if (term.contains('xterm') || term.contains('256color')) return true;

  return io.stdout.supportsAnsiEscapes;
}