From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27688 invoked by alias); 26 Jun 2012 07:31:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30531 Received: (qmail 2655 invoked from network); 26 Jun 2012 07:31:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120626003042.ZM19270@torch.brasslantern.com> Date: Tue, 26 Jun 2012 00:30:42 -0700 In-reply-to: <120626000311.ZM19019@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: crashes when setting COLUMNS=0 or 1" (Jun 26, 12:03am) References: <20120626033802.GA3066@primenet.com.au> <120626000311.ZM19019@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: crashes when setting COLUMNS=0 or 1 MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 26, 12:03am, Bart Schaefer wrote: } } In recent version adjustcolumns() has this: } } #ifdef TIOCGWINSZ } if (signalled || zterm_columns <= 0) } zterm_columns = shttyinfo.winsize.ws_col; } else } shttyinfo.winsize.ws_col = zterm_columns; } #endif /* TIOCGWINSZ */ } if (zterm_columns <= 0) { } DPUTS(signalled, "BUG: Impossible TIOCGWINSZ cols"); } zterm_columns = tccolumns > 0 ? tccolumns : 80; } } } } This is called from adjustwinsize() So, interesting side-effect: If my patch for IPDEF5 is applied, then settings of COLUMNS and LINES get propagated through to the tty driver and can end up affecting the behavior of the parent shell (or anything else that's using the terminal where those values were changed), even after the shell where the assignments were made has exited. E.g. (COLUMNS=20) in a subshell will change the tty driver which will signal the parent shell which will pick up the change and set its own column width to 20. This is the only case I can think of where a parameter assigned in a subshell can behave this way. So we might want to consider carefully whether this is something we want to inject only days before a 5.0.0 release ... but we should still fix the crash somehow, so maybe there's a corresponding change needed in some other place.