feat(01-02): implement terminal init/restore and panic hook

- init_terminal() enables raw mode and clears main screen via Viewport::Fullscreen
- No alternate screen buffer used (deliberate BBS immersive approach)
- restore_terminal() disables raw mode and shows cursor using let _ for all calls
- install_panic_hook() restores terminal, prints BBS-themed message, delegates to original hook
- Use ratatui::crossterm re-export (crossterm is transitive dep only)
- All panic hook operations use let _ or eprintln! — no unwrap() or ? inside hook
This commit is contained in:
2026-02-28 21:12:04 +01:00
parent c9a777ddbc
commit b258b6d262
2 changed files with 118 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
mod config;
mod terminal;
fn main() {
// 1. Detect login shell BEFORE stripping argv[0]
let is_login_shell = config::detect_login_shell();
// 2. Parse CLI (strips dash from argv[0] internally)
let cli = config::parse_cli();
// 3. Resolve config path and load config
let config_path = config::resolve_config_path(cli.config.as_deref());
let app_config = match config::load_config(&config_path) {
Ok(c) => c,
Err(e) => {
config::print_config_error(&e);
std::process::exit(1);
}
};
// Phase 1 placeholder: print loaded config for verification
// This will be replaced by terminal init + event loop in Plan 03
println!("Config loaded: {:?}", app_config);
println!("Login shell: {}", is_login_shell);
}