Dockerfile and main.rs changes revert
All checks were successful
Deploy to VPS / deploy (push) Successful in 1m1s
All checks were successful
Deploy to VPS / deploy (push) Successful in 1m1s
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -11,14 +11,14 @@ use ratatui::{backend::CrosstermBackend, Terminal};
|
||||
use std::io::stdout;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
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)?;
|
||||
|
||||
Reference in New Issue
Block a user