in node_modules_native/node_modules_forked/node-pty/src/win/pty.cc [239:267]
static NAN_METHOD(PtyResize) {
Nan::HandleScope scope;
if (info.Length() != 3 ||
!info[0]->IsNumber() ||
!info[1]->IsNumber() ||
!info[2]->IsNumber()) {
Nan::ThrowError("Usage: pty.resize(pid, cols, rows)");
return;
}
int handle = info[0]->Int32Value();
int cols = info[1]->Int32Value();
int rows = info[2]->Int32Value();
winpty_t *pc = get_pipe_handle(handle);
if (pc == nullptr) {
Nan::ThrowError("The pty doesn't appear to exist");
return;
}
BOOL success = winpty_set_size(pc, cols, rows, nullptr);
if (!success) {
Nan::ThrowError("The pty could not be resized");
return;
}
return info.GetReturnValue().SetUndefined();
}