NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/57053: continuation problem in shell pipelines



>Number:         57053
>Category:       bin
>Synopsis:       continuation problem in shell pipelines
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 12 12:40:00 +0000 2022
>Originator:     Thomas Klausner
>Release:        NetBSD 9.99.100
>Organization:

>Environment:
	
	
Architecture: x86_64
Machine: amd64
>Description:
I've been using the following shell function for ages:

dir() { ls -al "$@" | less; }

On -current (9.99.100 kernel from Oct 9, Userland from Sep 21, zsh
from May), when I CTRL-Z the less(1) and then want to go back in, it
doesn't work and I see the following:

> dir
zsh: done       ls -al "$@" |
zsh: suspended
> fg
[1]  + done       ls -al "$@" |
       continued
zsh: done                    ls -al "$@" |
zsh: suspended (tty output)
zsh: done                    ls -al "$@" |
zsh: suspended (tty output)

That happens every time I try to 'fg' it.

This was working fine not so long ago, but I don't remember exactly
when it started happening.

Others can reproduce this problem (see current-users) in /bin/sh and /bin/zsh.

/bin/bash and ksh93 seem to work fine.

RVP mentioned:
> Since less sucks up its entire input, the ls command is "done"
> and has exited in that pipeline (if you page forward a few screens).
> The ls exiting in the pipeline seems to confuse zsh and /bin/sh.

> If you run the function on a large dir. and suspend it at the 1st
> screen, then /bin/sh also works because ls is still running and
> can be suspended.

> ksh also says "Done", but it still allows the pipeline to be fg'd
> correctly:

> [1] + Done                 ls -al "$@" |
> Stopped              less

>How-To-Repeat:
See above.

>Fix:
Please

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index