getDisplayPath function
Get display path (shorten home dir to ~).
Implementation
String getDisplayPath(String filePath) {
final homeDir = Platform.environment['HOME'] ?? '';
if (filePath.startsWith(homeDir)) {
return '~${filePath.substring(homeDir.length)}';
}
return filePath;
}