<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - ioctl for request TIOCGWINSZ on STDOUT_FILENO not working on OS X"
   href="https://llvm.org/bugs/show_bug.cgi?id=30251">30251</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ioctl for request TIOCGWINSZ on STDOUT_FILENO not working on OS X
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>617283945a@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When debugging a process in LLDB using the ``process launch -c /bin/sh'', using
ioctl with request TIOCGWINSZ on STDOUT_FILENO always gives the width and
height of the window as zero and zero.

Test program:

#include <unistd.h>
#include <sys/ioctl.h>
#include <stdio.h>

void main(){
    struct winsize tty_window_size;

    ioctl(STDOUT_FILENO, TIOCGWINSZ, &tty_window_size);

    printf("Rows: %i, Cols: %i\n", tty_window_size.ws_row,
tty_window_size.ws_col);
}

When run from terminal:

$ ./test_ioctl
Rows: 24, Cols: 80
$ lldb -v
lldb-320.4.156
$ lldb ./test_ioctl
(lldb) target create "./a.out"
(lldb) process launch -c /bin/sh
Rows: 0, Cols: 0
(lldb) q</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>