Remove the terminal size checks since they've caused so many issues since their introduction
This commit is contained in:
@@ -113,7 +113,7 @@ To see all available commands, simply run `managarr --help`:
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ managarr --help
|
$ managarr --help
|
||||||
managarr 0.1.3
|
managarr 0.1.5
|
||||||
Alex Clarke <alex.j.tusa@gmail.com>
|
Alex Clarke <alex.j.tusa@gmail.com>
|
||||||
|
|
||||||
A TUI and CLI to manage your Servarrs
|
A TUI and CLI to manage your Servarrs
|
||||||
@@ -127,7 +127,6 @@ Commands:
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
--config <CONFIG> The Managarr configuration file to use
|
--config <CONFIG> The Managarr configuration file to use
|
||||||
--disable-terminal-size-checks Disable the terminal size checks
|
|
||||||
-h, --help Print help
|
-h, --help Print help
|
||||||
-V, --version Print version
|
-V, --version Print version
|
||||||
```
|
```
|
||||||
@@ -159,7 +158,6 @@ Commands:
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
--config <CONFIG> The Managarr configuration file to use
|
--config <CONFIG> The Managarr configuration file to use
|
||||||
--disable-terminal-size-checks Disable the terminal size checks
|
|
||||||
-h, --help Print help
|
-h, --help Print help
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -250,7 +248,6 @@ Managarr supports using environment variables on startup so you don't have to al
|
|||||||
| Variable | Description | Equivalent Flag |
|
| Variable | Description | Equivalent Flag |
|
||||||
| --------------------------------------- | -------------------------------- | -------------------------------- |
|
| --------------------------------------- | -------------------------------- | -------------------------------- |
|
||||||
| `MANAGARR_CONFIG_FILE` | Set the path to the config file | `--config` |
|
| `MANAGARR_CONFIG_FILE` | Set the path to the config file | `--config` |
|
||||||
| `MANAGARR_DISABLE_TERMINAL_SIZE_CHECKS` | Disable the terminal size checks | `--disable-terminal-size-checks` |
|
|
||||||
|
|
||||||
## Track My Progress for the Beta release (With Sonarr Support!)
|
## Track My Progress for the Beta release (With Sonarr Support!)
|
||||||
Progress for the beta release can be followed on my [Wekan Board](https://wekan.alexjclarke.com/b/dHoGjBb44MHM9HSv4/managarr)
|
Progress for the beta release can be followed on my [Wekan Board](https://wekan.alexjclarke.com/b/dHoGjBb44MHM9HSv4/managarr)
|
||||||
|
|||||||
+3
-26
@@ -18,7 +18,7 @@ use clap_complete::generate;
|
|||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use crossterm::execute;
|
use crossterm::execute;
|
||||||
use crossterm::terminal::{
|
use crossterm::terminal::{
|
||||||
disable_raw_mode, enable_raw_mode, size, EnterAlternateScreen, LeaveAlternateScreen,
|
disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen,
|
||||||
};
|
};
|
||||||
use log::error;
|
use log::error;
|
||||||
use network::NetworkTrait;
|
use network::NetworkTrait;
|
||||||
@@ -46,9 +46,6 @@ mod network;
|
|||||||
mod ui;
|
mod ui;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
static MIN_TERM_WIDTH: u16 = 205;
|
|
||||||
static MIN_TERM_HEIGHT: u16 = 40;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
#[command(
|
#[command(
|
||||||
name = crate_name!(),
|
name = crate_name!(),
|
||||||
@@ -75,13 +72,6 @@ struct Cli {
|
|||||||
help = "The Managarr configuration file to use"
|
help = "The Managarr configuration file to use"
|
||||||
)]
|
)]
|
||||||
config: Option<PathBuf>,
|
config: Option<PathBuf>,
|
||||||
#[arg(
|
|
||||||
long,
|
|
||||||
global = true,
|
|
||||||
env = "MANAGARR_DISABLE_TERMINAL_SIZE_CHECKS",
|
|
||||||
help = "Disable the terminal size checks"
|
|
||||||
)]
|
|
||||||
disable_terminal_size_checks: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -137,7 +127,7 @@ async fn main() -> Result<()> {
|
|||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
start_networking(sync_network_rx, &app_nw, cancellation_token, reqwest_client)
|
start_networking(sync_network_rx, &app_nw, cancellation_token, reqwest_client)
|
||||||
});
|
});
|
||||||
start_ui(&app, !args.disable_terminal_size_checks).await?;
|
start_ui(&app).await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,20 +150,7 @@ async fn start_networking(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn start_ui(app: &Arc<Mutex<App<'_>>>, check_terminal_size: bool) -> Result<()> {
|
async fn start_ui(app: &Arc<Mutex<App<'_>>>) -> Result<()> {
|
||||||
if check_terminal_size {
|
|
||||||
let (width, height) = size()?;
|
|
||||||
if width < MIN_TERM_WIDTH || height < MIN_TERM_HEIGHT {
|
|
||||||
return Err(anyhow!(
|
|
||||||
"Terminal too small. Minimum size required: {}x{}; current terminal size: {}x{}",
|
|
||||||
MIN_TERM_WIDTH,
|
|
||||||
MIN_TERM_HEIGHT,
|
|
||||||
width,
|
|
||||||
height
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut stdout = io::stdout();
|
let mut stdout = io::stdout();
|
||||||
enable_raw_mode()?;
|
enable_raw_mode()?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user