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"
|
ENV PATH="/root/.cargo/bin:$PATH"
|
||||||
|
|
||||||
COPY . /app
|
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
|
EXPOSE 22
|
||||||
CMD ["/usr/local/bin/sshserver"]
|
CMD ["/usr/local/bin/sshserver"]
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ use ratatui::{backend::CrosstermBackend, Terminal};
|
|||||||
use std::io::stdout;
|
use std::io::stdout;
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
eprintln!("TUI started");
|
||||||
enable_raw_mode()?;
|
enable_raw_mode()?;
|
||||||
let (width, height) = match crossterm::terminal::size() {
|
let (width, height) = match crossterm::terminal::size() {
|
||||||
Ok((w, h)) if w > 0 && h > 0 => (w, h),
|
Ok((w, h)) if w > 0 && h > 0 => (w, h),
|
||||||
_ => (80, 24),
|
_ => (80, 24),
|
||||||
};
|
};
|
||||||
println!("Width: {}, Height: {}", width, height);
|
println!("Width: {}, Height: {}", width, height);
|
||||||
let use_alternate_screen =
|
let use_alternate_screen = true;
|
||||||
std::env::var("SSH_CLIENT").is_err() && std::env::var("SSH_TTY").is_err();
|
|
||||||
let mut stdout = stdout();
|
let mut stdout = stdout();
|
||||||
if use_alternate_screen {
|
if use_alternate_screen {
|
||||||
execute!(stdout, EnterAlternateScreen)?;
|
execute!(stdout, EnterAlternateScreen)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user