zsh-workers
 help / color / mirror / code / Atom feed
* Zsh looping on commands that produce long output
@ 2007-07-31  2:40 Jeffrey Merrick
  2007-07-31 12:45 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey Merrick @ 2007-07-31  2:40 UTC (permalink / raw)
  To: zsh-workers


Hi,

I've repeatedly run into the problem of zsh looping when running commands that produce many (like, 200 or more) lines of output.  If you can imagine the output having line numbers, what happens is something like this:

     line 400
     line 401
     line 402
     line 382
     line 383
       .....
     line 401
     line 402
     line 382 
     line 383 
       .....
     line 401
     line 402
     line 382
     line 383

and so forth.  It is as if a circular buffer is being repeatedly displayed, without ever getting to the next line (403 and following).

Some commands that I've had problems with are:

% ls -l -F --color=tty  # when the directory contains a large number of files
% ps -A
% diff file1 file2 # when the numbers of lines of change was large

The problem does not happen in a predictable manner; I cannot repeat the problem every time. However, once it happens on one zsh session on a machine, I can create zsh session on the same machine, repeat the command (or any other command that produces a lot of output), and it is guaranteed to have the same looping problem as the first.  Note that when this happens, the output that is repeated is particular to the command typed at that shell; if one shell session is looping on an 'ls' comamnd, and I do a 'ps -A' in another shell, the second shell gets repeated process status lines and not repeated directory listing lines.  (Note:  I'm one of the very few zsh users at my company, so it's very likely I'm running all the instances of zsh on a given machine.)  When I kill all instances of zsh on the machine and login again, the problem goes away. 

Thus, it's as if there is some shared state across all running zsh instances that triggers the looping behavior, and the state is cleared only by killing all the zsh instances.

The problem seems to be independent of zsh version.  My company has zsh version 4.0.4, but I built version 4.2.6 myself and encountered the same problem.

The platform is an i686-pc-linux-gnu running i386-redhat-linux8.0.  I create the zsh login shells by ssh'ing from my Mac PowerBook to the company machine.  (Actually, my login shell is tcsh, but I exec zsh during shell startup.)

I don't subscribe to zsh-workers, but I will be checking the archive at 'zsh.org/mla' daily.  Those interested in more details can feel free to send me private email.

Thanks for any help you can provide.

And thanks to everyone who maintains zsh!  It's truly the best shell I've ever used.  Having started using it about a month ago, I can't imagine going back to use anything else.

Jeff
_________________________________________________________________
Missed the show?  Watch videos of the Live Earth Concert on MSN.
http://liveearth.msn.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Zsh looping on commands that produce long output
  2007-07-31  2:40 Zsh looping on commands that produce long output Jeffrey Merrick
@ 2007-07-31 12:45 ` Peter Stephenson
  2007-07-31 15:21   ` Angel Olivera
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2007-07-31 12:45 UTC (permalink / raw)
  To: zsh-workers

On Mon, 30 Jul 2007 19:40:33 -0700
Jeffrey Merrick <jeff.merrick@hotmail.com> wrote:
> I've repeatedly run into the problem of zsh looping when running commands
> that produce many (like, 200 or more) lines of output.
>...
> Thus, it's as if there is some shared state across all running zsh
> instances that triggers the looping behavior, and the state is cleared only
> by killing all the zsh instances.

This doesn't sound like any previously reported problem.  The nearest thing
to shared state between shells is the history mechanism; if you have the
SHARE_HISTORY option set it will try to read history just written by other
shells, but it won't try to execute it.

Do you have any precmd, preexec or chpwd functions, or anything similar, or
some session management layer such as screen?

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Zsh looping on commands that produce long output
  2007-07-31 12:45 ` Peter Stephenson
@ 2007-07-31 15:21   ` Angel Olivera
  0 siblings, 0 replies; 3+ messages in thread
From: Angel Olivera @ 2007-07-31 15:21 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

On Tue 31.Jul.07 13:45, Peter Stephenson wrote:
>Do you have any precmd, preexec or chpwd functions, or anything 
>similar, or
>some session management layer such as screen?

I experienced the same problem when I first switched to zsh because of 
poorly written (by myself) precmd/preexec functions, I can't remember 
exactly what it was.

It was harder for me to reproduce it, so you can imagine how badly this 
bothered me when writing awk scripts to parse log files, until I 
discovered I had to correct my zshrc.

-- 
redondos

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-31 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-31  2:40 Zsh looping on commands that produce long output Jeffrey Merrick
2007-07-31 12:45 ` Peter Stephenson
2007-07-31 15:21   ` Angel Olivera

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).