Current-Users archive

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

Re: weird less(1) CTRL-Z behaviour




On 12 October 2022 11:36:04 (+01:00), Chavdar Ivanov wrote:

>
>
> On 12 October 2022 11:13:05 (+01:00), Thomas Klausner wrote:
>
> > Hi!
> >
> > 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.
> Seems specific to the shell. I get the same with zsh, with /bin/sh I get:
> ....
> $ exec /bin/sh
> $ dir() { ls -al "$@" | less; }
> $ dir
> [1] + Done ls -al "${@}" |
> Suspended less
> $ fg
> ls -al "${@}" | less
> fg: Cannot continue job (No such process)
> $ jobs
> [1] + Done ls -al "${@}" |
> Suspended less
> $ fg
> ls -al "${@}" | less
> fg: Cannot continue job (No such process)
> $
> ....
>
> However, with /usr/pkg/bin/ksh93 from the latest pkgsrc package, it works as expected:
>
> ...
> ➜ ~ exec ksh93
> [xci@ymir ~]; dir() { /bin/ls -al "$@" | less; }
> [xci@ymir ~]; dir
> [1] + Stopped dir
> [xci@ymir ~]; fg ---- it gets me back into less, which I exit
> dir
> [xci@ymir ~]; fg
> ksh93: fg: no such job
> [xci@ymir ~];
> ....
>
It also works as expected with bash.
  
> >
> > This was working fine not so long ago, but I don't remember exactly
> > when it started happening.
> > Thomas
> >
>
>

-- 
----
Chavdar Ivanov


Home | Main Index | Thread Index | Old Index