getShellHistoryFile function

String? getShellHistoryFile(
  1. ShellType type
)

Get the user's shell history file.

Implementation

String? getShellHistoryFile(ShellType type) {
  final home = Platform.environment['HOME'];
  if (home == null) return null;

  return switch (type) {
    ShellType.bash => '$home/.bash_history',
    ShellType.zsh => '$home/.zsh_history',
    ShellType.fish => '$home/.local/share/fish/fish_history',
    _ => null,
  };
}