diff --git a/Dockerfile b/Dockerfile index 33dde49..fdcd0f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN apk add --no-cache curl && \ ENV PATH="/root/.cargo/bin:$PATH" COPY . /app -RUN cd /app && cargo build --release && cp target/release/ssh-tui /app/tui +RUN cd /app && cargo build --release && cp target/release/ssh-tui /app/tui && chmod +x /app/tui EXPOSE 22 CMD ["/usr/local/bin/sshserver"] diff --git a/src/main.rs b/src/main.rs index 1ca0234..5c4ef9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,14 +11,14 @@ use ratatui::{backend::CrosstermBackend, Terminal}; use std::io::stdout; fn main() -> Result<(), Box> { + eprintln!("TUI started"); enable_raw_mode()?; let (width, height) = match crossterm::terminal::size() { Ok((w, h)) if w > 0 && h > 0 => (w, h), _ => (80, 24), }; println!("Width: {}, Height: {}", width, height); - let use_alternate_screen = - std::env::var("SSH_CLIENT").is_err() && std::env::var("SSH_TTY").is_err(); + let use_alternate_screen = true; let mut stdout = stdout(); if use_alternate_screen { execute!(stdout, EnterAlternateScreen)?;