mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Move ConPTY resize to os_win_conpty.c
This commit is contained in:
parent
ed37d1081c
commit
7aff0340e1
@ -166,7 +166,19 @@ bool os_conpty_spawn(conpty_t *conpty_object, HANDLE *process_handle,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void os_conpty_free(conpty_t * conpty_object)
|
void os_conpty_set_size(conpty_t *conpty_object,
|
||||||
|
uint16_t width, uint16_t height)
|
||||||
|
{
|
||||||
|
assert(width <= SHRT_MAX);
|
||||||
|
assert(height <= SHRT_MAX);
|
||||||
|
COORD size = { (int16_t)width, (int16_t)height };
|
||||||
|
if (pResizePseudoConsole(conpty_object->pty, size) != S_OK) {
|
||||||
|
ELOG("ResizePseudoConsoel failed: error code: %d",
|
||||||
|
os_translate_sys_error((int)GetLastError()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void os_conpty_free(conpty_t *conpty_object)
|
||||||
{
|
{
|
||||||
if (conpty_object != NULL) {
|
if (conpty_object != NULL) {
|
||||||
if (conpty_object->si_ex.lpAttributeList != NULL) {
|
if (conpty_object->si_ex.lpAttributeList != NULL) {
|
||||||
|
@ -231,14 +231,7 @@ void pty_process_resize(PtyProcess *ptyproc, uint16_t width,
|
|||||||
{
|
{
|
||||||
if (ptyproc->type == PTY_TYPE_CONPTY
|
if (ptyproc->type == PTY_TYPE_CONPTY
|
||||||
&& ptyproc->object.conpty != NULL) {
|
&& ptyproc->object.conpty != NULL) {
|
||||||
assert(width <= SHRT_MAX);
|
os_conpty_set_size(ptyproc->object.conpty, width, height);
|
||||||
assert(height <= SHRT_MAX);
|
|
||||||
COORD size = { (int16_t)width, (int16_t)height };
|
|
||||||
if (pResizePseudoConsole(
|
|
||||||
ptyproc->object.conpty->pty, size) != S_OK) {
|
|
||||||
ELOG("ResizePseudoConsoel failed: error code: %d",
|
|
||||||
os_translate_sys_error((int)GetLastError()));
|
|
||||||
}
|
|
||||||
} else if (ptyproc->object.winpty != NULL) {
|
} else if (ptyproc->object.winpty != NULL) {
|
||||||
winpty_set_size(ptyproc->object.winpty, width, height, NULL);
|
winpty_set_size(ptyproc->object.winpty, width, height, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user