Source: rxvt
Version: 1:2.7.10-5.1
Severity: normal

Dear Maintainer,

The fix for Debian bug #202497 causes rxvt to not report its initial terminal
size correctly when queried with a standard ioctl() call. Only after the rxvt
window is resized can the terminal size be retrieved correctly.

The attached simple C program shows the ioctl call I am using to query the
terminal size. This uses the TIOCGWINSZ ioctl to get the terminal size of the
program's controlling terminal. When this program is run in a newly started
rxvt, the terminal size is returned as {0,0}. If the rxvt is resized with the
mouse and the program is run again, the correct updated size is returned.

This appears to be a Debian-specific problem, as the patch that was applied to
fix #202497 appears to be the cause of this behavior. When rxvt is rebuilt
without this patch, the correct initial size {24,80} is returned.

I don't fully understand the race condition mentioned in #202497, but it is
implied that the patch applied is only a band-aid and not a real fix. The patch
clearly introduces this undesired reproducible behavior into rxvt for Debian
users, so I would like to see it removed, but I can't comment on the original
problem with the terminal dimensions.



-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-- no debconf information
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <unistd.h>

int
main (int argc, char *argv[])
{
  struct winsize winsize;
  if (ioctl (STDIN_FILENO, TIOCGWINSZ, &winsize) != 0)
    {
      perror ("termsize");
      exit (EXIT_FAILURE);
    }
  else
    {
      printf ("winsize = struct { ws_row = %hu, ws_col = %hu }\n",
              winsize.ws_row, winsize.ws_col);
    }
  return EXIT_SUCCESS;
}

Reply via email to