zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh users list <zsh-users@sunsite.dk>
Subject: Re: Large COLUMNS crashes zsh
Date: Sat, 06 May 2006 13:51:55 +0100	[thread overview]
Message-ID: <200605061251.k46Cptgr004236@pwslaptop.csr.com> (raw)
In-Reply-To: Message from Miek Gieben <miek@miek.nl>  of "Fri, 05 May 2006 17:33:22 +0200." <20060505153322.GE8197@miek.nl>

Miek Gieben wrote:
> bash seems handle this just fine. And it resets the value to something
> more sane (don't know if that is a bug or feature):
> 
> $ export COLUMNS=10000000000000000
> $ echo $COLUMNS
> 10000000000000000
> $ ls
> ...bunch of files...
> $ echo $COLUMNS
> 100
> $
> 
> This is with bash3. Zsh on the other hand is trying to trash my
> machine :)

zsh actually needs to know the number of columns internally for zle,
which stores all the lines it's printing out; this is needed to get
multiline buffers to work.  So if you get it wrong it's not going to
work properly anyway, even if we invent some kludge (and there are
plenty of possibilities).  I can't really think of a better answer than
"don't do that", offhand, but I'm open to specific suggestions.
(The question is not "is it bad for the shell to crash?"  The question
is "what do we do about it?")

By the way, if you simply don't want the shell to see a value you're
using in a function or script, there's a workaround:

fn() {
  local -hx COLUMNS=10000000000000000
}

The -h makes the parameter cover the special value; it's set in the
environment for the duration of the function but isn't coupled to the
shell's internall column setting.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2006-05-06 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-05 14:19 Mads Martin Joergensen
2006-05-05 14:32 ` Peter Stephenson
2006-05-05 15:33   ` Miek Gieben
2006-05-06 12:51     ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605061251.k46Cptgr004236@pwslaptop.csr.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).