<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57235>57235</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Error debugging nurses applications with output larger than 80 x 24
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          rserranon
      </td>
    </tr>
</table>

<pre>
    I try to debug a c++ ncurses application that creates a window larger than 80 x 24 and it works fine on terminal, but when I launch it in LLDB the creation of the window fails, the ncurses function `getmaxyx(y,x)` always returns x=80 y=24 while running in LLDB, independent of the larger size of the terminal widow. 

Mac OS: Big Sur
version: 11.6.6
chip: M1

lldb-1300.0.42.3 (installed via Homebrew)
Swift version 5.5.2-dev

```cpp
    WINDOW *console;
    int lnConsoleX = 0;
    int lnConsoleY = 0;


    console = initscr();
    noecho();
    curs_set(0);
    border(0,0,0,0,0,0,0,0);
    getmaxyx(console, lnConsoleY, lnConsoleX);
    if (!console ) {
      endwin();
      std::cout << "Error initializing nCurses \n";
      return -1;
    }
    printw("[ConsoleY:%d , ", lnConsoleY);
    printw("ConsoleX:%d]", lnConsoleX);
    if ( width > lnConsoleX ) {
      endwin();
      std::cout << "Error Console game is larger in (x,y) than Terminal or y or y are larger than height, width \n";
      return -1;
    }

```

```
Process 18331 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0000000100006060 Racing-game`ConsoleGameEngine::ConstructConsole(this=0x000000016fdff610, x=1, y=1, width=137, height=37, border=true, label="Racing Game") at ncurses-game-engine.cpp:65:7
   62       if ( width > lnConsoleX ) {
   63         endwin();
   64         std::cout << "Error Console game is larger in (x,y) than Terminal or y or y are larger than height, width \n";
-> 65              return -1;
   66       }
   67       m_nScreenWidth  = width;
   68       m_nScreenHeight = height;
Target 0: (Racing-game) stopped.
(lldb) fr v
(RacingGame *) this = 0x000000016fdff610
(int) x = 1
(int) y = 1
(int) width = 137
(int) height = 37
(bool) border = true
(std::string) label = "Racing Game"
(WINDOW *) console = 0x0000000100404e20
(int) lnConsoleX = 80
(int) lnConsoleY = 24
(std::string) title = ""
(int) x_tit = 0
(lldb) 
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNVt1zozYQ_2vwy44ZEAbjBz84dnKXmbtep7mZXJ8yMghQiwWVRBzfX9-VBDYmHzPt9KEOlqPd1e5vP8W-yU_re9DyBLqBnO27EihkHrnBB0TWScUU0LateUY1bwToimrIJKPaMODIRd4coaayZNIwBaQBvABZABU5cA3HRv6poOCCgTnO5IELWntkC_sOuRUTcI_nO5FVRpwL-PJld4OqmDNjjDaF3ffGCsprZRQY2oCxQAVW1kuCkukDfTm9eCQ9oRz-rpAKtD7SkwLJdCeFghcv2iHWE_4g2mPFawayE4KLckBhjKBN1jJchB5w9N4q_pMNpMEvxIgQffCCnRds3PqVZvDtwYs2cMNLeOikIz8zqRCwoYehn_iJI2cVbw3tazjWUdf5fh5GQeAH_oL4EaBvXChN65rl8MwpfG4ObC_Z0ThrjzwceaGhtwKxH_tknrPnsVaMinuytnUUwM_j_S-7b49oYZM1QjU186KbC5djHGqxdZwfgNGD4H2B3ycC49UI9xasFBdcq0yiZ8aHsUrRsKxq3mCY5D8pppEVTHn7RuZMOs72g-_1qVHtDN5jEVz8udr9mJ7mBViU4dkvsgJvOZIAwFrCQn7DGQClc0w9PlmDveFFW3xQBbmVspE2PpzW_KepULF1de_FW9RFJopcjcM8vKJ7y91l00pM1NHCIF58c_YP7ZM4B-On4Uycv0Y81nEOiVPgxbvp8XeiZVpGV-jt7VVd_YeB65VCSQ8MuBr6F5sclWGmtydjzQ6v70Mf47GTW6hkV_OtYrystPGsB_5vMjDpvw-Iv8omY0pBmEZRiI42bcvyXpJsEBIOSZOuKDSQ_upY57rJI8usOfhmdjP_QLmYO1GkG0GjCEFSZUYmiivNWmhwWlzAFtLECzUH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