X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fdrv%2Fpty.c;h=abfd9d14a26a258159d4029f751240590c5a7399;hb=5c29fcc13d3db145e00c01f88d0a584966c6bc38;hp=ace6c53ba111f14440197688098c456723d40087;hpb=1dc089a0b5b31e8e75e85128a03b7be20d4995f5;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/drv/pty.c b/KernelLand/Kernel/drv/pty.c index ace6c53b..abfd9d14 100644 --- a/KernelLand/Kernel/drv/pty.c +++ b/KernelLand/Kernel/drv/pty.c @@ -5,7 +5,7 @@ * drv/pty.c * - Pseudo Terminals */ -#define DEBUG 0 +#define DEBUG 1 #include #include #include @@ -230,8 +230,7 @@ int PTY_SetAttrib(tPTY *PTY, const struct ptydims *Dims, const struct ptymode *M errno = EINVAL; return -1; } - PTY->Mode = *Mode; - if( !WasClient ) + if( WasClient ) { if( PTY->ModeSet && PTY->ModeSet(PTY->OutputHandle, Mode) ) { @@ -245,10 +244,17 @@ int PTY_SetAttrib(tPTY *PTY, const struct ptydims *Dims, const struct ptymode *M // ACK by server doing GETMODE } } + else + { + // Should the client be informed that the server just twiddled the modes? + } + LOG("PTY %p mode set to {0%o, 0%o}", PTY, Mode->InputMode, Mode->OutputMode); + PTY->Mode = *Mode; } if( Dims ) { - if( WasClient ) { + if( WasClient ) + { // Poke the server? if( PTY->ReqResize && PTY->ReqResize(PTY->OutputHandle, Dims) ) { @@ -260,9 +266,11 @@ int PTY_SetAttrib(tPTY *PTY, const struct ptydims *Dims, const struct ptymode *M // Inform server process... somehow } } - else { + else + { // SIGWINSZ to client } + LOG("PTY %p dims set to %ix%i", PTY, Dims->W, Dims->H); PTY->Dims = *Dims; } return 0;