isWslEnvironment function

bool isWslEnvironment()

Implementation

bool isWslEnvironment() {
  if (_wslCache != null) return _wslCache!;
  try {
    _wslCache = File('/proc/sys/fs/binfmt_misc/WSLInterop').existsSync();
  } catch (_) {
    _wslCache = false;
  }
  return _wslCache!;
}