From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#24608: 26.0.50; PTY window size initially zero Date: Tue, 04 Oct 2016 10:18:05 +0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475569169 12815 195.159.176.226 (4 Oct 2016 08:19:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Oct 2016 08:19:29 +0000 (UTC) To: 24608@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 04 10:19:25 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brKwX-0001mh-0s for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Oct 2016 10:19:17 +0200 Original-Received: from localhost ([::1]:40753 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brKwV-0005kc-Eq for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Oct 2016 04:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brKwM-0005kH-6Z for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2016 04:19:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brKwI-0000NR-OE for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2016 04:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brKwI-0000NJ-Kb for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2016 04:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1brKwI-0003Ji-DI for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2016 04:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Oct 2016 08:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24608 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147556912212713 (code B ref -1); Tue, 04 Oct 2016 08:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Oct 2016 08:18:42 +0000 Original-Received: from localhost ([127.0.0.1]:43759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brKvx-0003Iz-T4 for submit@debbugs.gnu.org; Tue, 04 Oct 2016 04:18:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brKvw-0003Ij-GW for submit@debbugs.gnu.org; Tue, 04 Oct 2016 04:18:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brKvq-0008S8-85 for submit@debbugs.gnu.org; Tue, 04 Oct 2016 04:18:35 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brKvq-0008RJ-4H for submit@debbugs.gnu.org; Tue, 04 Oct 2016 04:18:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brKvn-0005i2-Q9 for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2016 04:18:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brKvj-0008N2-J4 for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2016 04:18:30 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:36863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brKvj-0008ML-As for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2016 04:18:27 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id k125so192051683wma.1 for ; Tue, 04 Oct 2016 01:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version; bh=FK5RxMu/qee48t9MkPaXZIfxL9VWVcZPIMfPyqWeikw=; b=z4RHJG8kGy8bQ359ZTyw5Eg3/bIv3xn/VsgpCJ/CCJRKSCcbLPhYAy3GRnRIXJmVhk 6I/0YlpWmYrGzNnQS7soBOmFmTAZ5o7FVf+qCUhNuR05/1/lj6ndTYCYJ2rMkvTPkEQR srn+qBtLU4tUm95XYtv6TdBrSamoR8QFvZ5lL+W4WPJz45WdMDFLVN/vBZm5EndHoqqP pnft5McnhOvvxvnU0fRk4nKptm1AT3irnKsxnCXG171+bZPM5ogKTPNjmgvcV+taOqDD IPAKm4sM7E5063i7B5vJthgKo+/LcUZvC8dn+9C8yHM8r8OKYvnJx4EPOpugJyd/5cGh iqMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=FK5RxMu/qee48t9MkPaXZIfxL9VWVcZPIMfPyqWeikw=; b=RFRbSA5jQUlTizM8pd0uNrbYEDszpgQuWUexEcfVvq9Ai98rn+hRyw2szQGQ9LSgI8 qAbTyuWQI8lpGwyudbAYcRiCRAMqUqi8M/pUI2SCtDAtyPZd9fSZ0vTijA6Moju5ICqY 5AV7jd7LphwyYmjd9ELyGItm9qftN1VW17+W6URMeP6T1wjjcCFOdwgnExYRwP+WaWmb j5jciWeFJBdxlqPWBPXFvC8YKlGQ5TFnsrqoLFogdF1DThusL2gRa1MKgwpMtmBimcLT sbjZjnK+qIWGfOB63am0T2BbTZcXgPrommqAWiztlwjl7HcELi92pKwP49xEt2dNnDEl GOFA== X-Gm-Message-State: AA6/9RkEjPAAID2UOuq1nwD6MEuduxvfDmXjHmB3kauHEET64fLOzB/VGXHE/iwUspTkVg== X-Received: by 10.28.113.80 with SMTP id m77mr2579417wmc.18.1475569106123; Tue, 04 Oct 2016 01:18:26 -0700 (PDT) Original-Received: from caladan ([212.46.174.61]) by smtp.gmail.com with ESMTPSA id b8sm2172027wjq.40.2016.10.04.01.18.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Oct 2016 01:18:25 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124028 Archived-At: When a subprocess tries to read the window size of the tty with the TIOCGWINSZ ioctl the result is initially zero. This causes problems for programs that aren't prepared for zero sized windows. It would be better if the size would be initialized correctly or at least not be zero. To reproduce the situation compile the attached C program and execute Emacs like this: emacs -Q -nw -f shell \ --eval '(progn (sit-for 1) (insert "getwinsize") (comint-send-input))' \ --eval '(progn (sit-for 1) (insert "getwinsize") (comint-send-input))' \ --eval '(progn (sit-for 1) (delete-other-windows) (insert "getwinsize") (comint-send-input))' After that, the *shell* buffer look like so: helmut@caladan:/tmp> getwinsize Window size: 0 columns 0 rows helmut@caladan:/tmp> getwinsize Window size: 0 columns 0 rows helmut@caladan:/tmp> getwinsize Window size: 80 columns 21 rows helmut@caladan:/tmp> We see that the size is initially zero but after resizing the window the size is no longer zero. (Note: when typing the commands manually tab-completion may create temporary windows and will initialize the window size as side effect.) Here the C programm to read the window size: /* -*- compile-command:"cc getwinsize.c -o getwinsize" -*- */ #include #include #include #include #include int main(int argc, char **argv) { struct winsize sz; if (ioctl (0, TIOCGWINSZ, &sz) == -1) { printf ("ioctl failed: %s", strerror (errno)); exit (1); } printf ("Window size: %i columns %i rows\n", sz.ws_col, sz.ws_row); return 0; } In GNU Emacs 26.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5) of 2016-10-04 built on caladan Repository revision: e2913dc880b9843bf69cf885270551bafeb46120 Windowing system distributor 'The X.Org Foundation', version 11.0.11604000 System Description: Debian GNU/Linux 8.5 (jessie) Configured using: 'configure --with-xpm=no --with-jpeg=no --with-gif=no --with-tiff=no' Configured features: PNG SOUND DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: C.UTF-8 locale-coding-system: utf-8-unix