Skip to content

Commit

Permalink
term-ux fix shrinking while running in gdb (#128)
Browse files Browse the repository at this point in the history
Resizing to a bigger window size as the initial one still does not work
while running term-ux with gdb
  • Loading branch information
ChillerDragon committed Mar 8, 2023
1 parent d17fbec commit 627e1c6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <base/terminalui.h>

#include <csignal>
#include <sys/ioctl.h>

#include "terminalui.h"

Expand Down Expand Up @@ -83,7 +84,13 @@ void CTerminalUI::InputDraw()

int CTerminalUI::CursesTick()
{
getmaxyx(stdscr, g_NewY, g_NewX);
// getmaxyx does not work with gdb see https://github.com/chillerbot/chillerbot-ux/issues/128
// getmaxyx(stdscr, g_NewY, g_NewX);

struct winsize w;
ioctl(0, TIOCGWINSZ, &w);
g_NewX = w.ws_col;
g_NewY = w.ws_row;

if(g_NewY != g_ParentY || g_NewX != g_ParentX)
{
Expand Down

0 comments on commit 627e1c6

Please sign in to comment.