captureTerminalPreference function

String? captureTerminalPreference()

Capture the current terminal from TERM_PROGRAM and return the app name. Returns null if not on macOS or TERM_PROGRAM not recognized.

Implementation

String? captureTerminalPreference() {
  if (!Platform.isMacOS) return null;

  final termProgram = Platform.environment['TERM_PROGRAM'];
  if (termProgram == null) return null;

  return _termProgramToApp[termProgram.toLowerCase()];
}