mosh-server: allow startup with PTY with zero width or height like Emacs shell.
Closes #472 Closes #473
This commit is contained in:
committed by
Keith Winstein
parent
27678941d4
commit
96bf5af1b4
@@ -325,7 +325,9 @@ int run_server( const char *desired_ip, const char *desired_port,
|
|||||||
const int colors, bool verbose, bool with_motd ) {
|
const int colors, bool verbose, bool with_motd ) {
|
||||||
/* get initial window size */
|
/* get initial window size */
|
||||||
struct winsize window_size;
|
struct winsize window_size;
|
||||||
if ( ioctl( STDIN_FILENO, TIOCGWINSZ, &window_size ) < 0 ) {
|
if ( ioctl( STDIN_FILENO, TIOCGWINSZ, &window_size ) < 0 ||
|
||||||
|
window_size.ws_col == 0 ||
|
||||||
|
window_size.ws_row == 0 ) {
|
||||||
fprintf( stderr, "Server started without pseudo-terminal. Opening 80x24 terminal.\n" );
|
fprintf( stderr, "Server started without pseudo-terminal. Opening 80x24 terminal.\n" );
|
||||||
|
|
||||||
/* Fill in sensible defaults. */
|
/* Fill in sensible defaults. */
|
||||||
|
|||||||
Reference in New Issue
Block a user