From 7cd2790e3c3b7b16c77d2a3396a6f9e6a19353ea Mon Sep 17 00:00:00 2001 From: kirbylife Date: Thu, 23 Jul 2026 00:54:05 -0600 Subject: [PATCH] Initial boilerplate --- Cargo.toml | 1 + src/main.rs | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3b74985..fc964bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "sshmngrs" version = "0.1.0" edition = "2024" +description = "A fast and powerful SSH connection manager" [dependencies] ratatui = "0.30.2" diff --git a/src/main.rs b/src/main.rs index e7a11a9..aaa9f7a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,32 @@ -fn main() { - println!("Hello, world!"); +use ratatui::{ + crossterm::event::{self, Event, KeyCode, KeyEventKind}, + widgets::{Block, Borders}, + DefaultTerminal, Frame, +}; + +fn main() -> std::io::Result<()> { + let terminal = ratatui::init(); + let result = run(terminal); + ratatui::restore(); + result +} + +fn run(mut terminal: DefaultTerminal) -> std::io::Result<()> { + loop { + terminal.draw(draw)?; + + if let Event::Key(key) = event::read()? { + if key.kind == KeyEventKind::Press && key.code == KeyCode::Char('q') { + break; + } + } + } + Ok(()) +} + +fn draw(frame: &mut Frame) { + let block = Block::default() + .title("sshmngrs") + .borders(Borders::ALL); + frame.render_widget(block, frame.area()); }