mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 15:05:07 +00:00
Support resizing the Terminal app.
I set it up so that TIOCSWINSZ on a master PTY gets forwarded to the slave. This feels intuitively right. Terminal can then use that to inform the shell or whoever is inside the slave that the window size has changed. TIOCSWINSZ also triggers the generation of a SIGWINCH signal. :^)
This commit is contained in:
parent
0ca3112301
commit
0aaec6b19a
6 changed files with 74 additions and 19 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <Kernel/Process.h>
|
||||
#include <LibC/errno_numbers.h>
|
||||
#include <LibC/signal_numbers.h>
|
||||
#include <LibC/sys/ioctl_numbers.h>
|
||||
|
||||
MasterPTY::MasterPTY(unsigned index)
|
||||
: CharacterDevice(10, index)
|
||||
|
@ -87,3 +88,10 @@ void MasterPTY::close()
|
|||
m_slave->hang_up();
|
||||
}
|
||||
}
|
||||
|
||||
int MasterPTY::ioctl(Process& process, unsigned request, unsigned arg)
|
||||
{
|
||||
if (request == TIOCSWINSZ)
|
||||
return m_slave->ioctl(process, request, arg);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue