import 'package:meta/meta.dart';

/// The tmux pane backing a session row, as reported by `sessions_detail`.
@immutable
class Pane {
  final int? pid;
  final String? cwd;
  final String? cmd;
  final String? cmdFull;

  const Pane({this.pid, this.cwd, this.cmd, this.cmdFull});

  factory Pane.fromSessionJson(Map<String, dynamic> json) {
    return Pane(
      pid: json['pane_pid'] as int?,
      cwd: json['pane_cwd'] as String?,
      cmd: json['cmd'] as String?,
      cmdFull: json['cmd_full'] as String?,
    );
  }
}
