commandAsHint static method
Format a bash command for the hint display.
Implementation
static String commandAsHint(String command) {
final cleaned =
'\$ ${command.split('\n').map((l) => l.replaceAll(RegExp(r'\s+'), ' ').trim()).where((l) => l.isNotEmpty).join('\n')}';
return cleaned.length > _maxHintChars
? '${cleaned.substring(0, _maxHintChars - 1)}...'
: cleaned;
}