* fhandler.h (fhandler_tty_master::set_winsize): Declare new function.
* fhandler_console.cc (fhandler_console::send_winch_maybe): If appropriate, call tty master function to handle screen size change. * fhandler_tty.cc (fhandler_tty_master::set_winsize): New function. (fhandler_tty_master::init): Call set_winsize to set initial screen size.
This commit is contained in:
parent
3bfed277d6
commit
66dcfc4498
|
@ -1,3 +1,12 @@
|
||||||
|
2002-12-27 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* fhandler.h (fhandler_tty_master::set_winsize): Declare new function.
|
||||||
|
* fhandler_console.cc (fhandler_console::send_winch_maybe): If
|
||||||
|
appropriate, call tty master function to handle screen size change.
|
||||||
|
* fhandler_tty.cc (fhandler_tty_master::set_winsize): New function.
|
||||||
|
(fhandler_tty_master::init): Call set_winsize to set initial screen
|
||||||
|
size.
|
||||||
|
|
||||||
2002-12-26 Christopher Faylor <cgf@redhat.com>
|
2002-12-26 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* fhandler_tty.cc (fhandler_tty_master::init): Set initial size of tty
|
* fhandler_tty.cc (fhandler_tty_master::init): Set initial size of tty
|
||||||
|
|
|
@ -948,6 +948,7 @@ class fhandler_tty_master: public fhandler_pty_master
|
||||||
fhandler_tty_master (int unit);
|
fhandler_tty_master (int unit);
|
||||||
int init (int);
|
int init (int);
|
||||||
int init_console ();
|
int init_console ();
|
||||||
|
void set_winsize (bool);
|
||||||
void fixup_after_fork (HANDLE parent);
|
void fixup_after_fork (HANDLE parent);
|
||||||
void fixup_after_exec (HANDLE);
|
void fixup_after_exec (HANDLE);
|
||||||
};
|
};
|
||||||
|
|
|
@ -213,8 +213,14 @@ fhandler_console::send_winch_maybe ()
|
||||||
fillin_info ();
|
fillin_info ();
|
||||||
|
|
||||||
if (y != dev_state->info.dwWinSize.Y || x != dev_state->info.dwWinSize.X)
|
if (y != dev_state->info.dwWinSize.Y || x != dev_state->info.dwWinSize.X)
|
||||||
|
{
|
||||||
|
extern fhandler_tty_master *tty_master;
|
||||||
|
if (tty_master)
|
||||||
|
tty_master->set_winsize (true);
|
||||||
|
else
|
||||||
tc->kill_pgrp (SIGWINCH);
|
tc->kill_pgrp (SIGWINCH);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void __stdcall
|
void __stdcall
|
||||||
fhandler_console::read (void *pv, size_t& buflen)
|
fhandler_console::read (void *pv, size_t& buflen)
|
||||||
|
|
|
@ -40,6 +40,16 @@ fhandler_tty_master::fhandler_tty_master (int unit)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fhandler_tty_master::set_winsize (bool sendSIGWINCH)
|
||||||
|
{
|
||||||
|
winsize w;
|
||||||
|
console->ioctl (TIOCGWINSZ, &w);
|
||||||
|
get_ttyp ()->winsize = w;
|
||||||
|
if (sendSIGWINCH)
|
||||||
|
tc->kill_pgrp (SIGWINCH);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
fhandler_tty_master::init (int ntty)
|
fhandler_tty_master::init (int ntty)
|
||||||
{
|
{
|
||||||
|
@ -54,14 +64,13 @@ fhandler_tty_master::init (int ntty)
|
||||||
termios ti;
|
termios ti;
|
||||||
memset (&ti, 0, sizeof (ti));
|
memset (&ti, 0, sizeof (ti));
|
||||||
console->tcsetattr (0, &ti);
|
console->tcsetattr (0, &ti);
|
||||||
winsize w;
|
|
||||||
console->ioctl (TIOCGWINSZ, &w);
|
|
||||||
this->ioctl (TIOCSWINSZ, &w);
|
|
||||||
|
|
||||||
ttynum = ntty;
|
ttynum = ntty;
|
||||||
|
|
||||||
cygwin_shared->tty[ttynum]->common_init (this);
|
cygwin_shared->tty[ttynum]->common_init (this);
|
||||||
|
|
||||||
|
set_winsize (false);
|
||||||
|
|
||||||
inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE);
|
inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE);
|
||||||
|
|
||||||
cygthread *h;
|
cygthread *h;
|
||||||
|
|
Loading…
Reference in New Issue