Web Client #11

Merged
Simponic merged 19 commits from web into main 2023-01-19 16:04:10 -05:00
Showing only changes of commit 38fb530b60 - Show all commits

View File

@ -11,8 +11,6 @@ defmodule Chessh.SSH.Client do
@min_terminal_width 64 @min_terminal_width 64
@min_terminal_height 38 @min_terminal_height 38
@max_terminal_width 220
@max_terminal_height 100
defmodule State do defmodule State do
defstruct tui_pid: nil, defstruct tui_pid: nil,
@ -163,13 +161,10 @@ defmodule Chessh.SSH.Client do
end end
defp get_terminal_dim_msg(width, height) do defp get_terminal_dim_msg(width, height) do
case {height > @max_terminal_height, height < @min_terminal_height, case {height < @min_terminal_height, width < @min_terminal_width} do
width > @max_terminal_width, width < @min_terminal_width} do {true, _} -> {true, @clear_codes ++ ["The terminal height is too small."]}
{true, _, _, _} -> {true, @clear_codes ++ ["The terminal height is too large."]} {_, true} -> {true, @clear_codes ++ ["The terminal width is too small."]}
{_, true, _, _} -> {true, @clear_codes ++ ["The terminal height is too small."]} {false, false} -> {false, nil}
{_, _, true, _} -> {true, @clear_codes ++ ["The terminal width is too large"]}
{_, _, _, true} -> {true, @clear_codes ++ ["The terminal width is too small."]}
{false, false, false, false} -> {false, nil}
end end
end end