[Pkg-zsh-devel] Bug#660630: zsh: suspend (^Z) behavior while a function is running is unclear

Vincent Lefevre vincent at vinc17.net
Mon Feb 20 12:53:30 UTC 2012


Package: zsh
Version: 4.3.15-1
Severity: normal

The suspend (^Z) behavior while a function is running is unclear.
The documentation (man pages) should describe the behavior. There
may be a bug in zsh, as some other shells don't behave in the same
way.

Consider:

foo() { emacs "$@"; d=`date`; echo "$d"; }

and the following test under X (so that Emacs uses its own window,
or you can try with another X application):

1. Run foo.
2. Type ^Z in the terminal.
3. Type: fg [Return].
4. Quit Emacs.
5. Type: echo "$d" [Return].

With zsh, the whole function is suspended. The effect is that zsh is
forked (this is not documented, though can be guessed), thus $d will
not be set in the main shell (Step 5: nothing is displayed).

With bash, dash, mksh and pdksh, only the emacs process is suspended.
With ksh93, the ^Z is ignored until Emacs is quit, then the function
is suspended, with the same effects as in zsh. With posh, the whole
shell is suspended.

Versions of the packages:
  bash 4.2-1
  dash 0.5.7-2
  ksh 93u-1
  mksh 40.4-3
  pdksh 5.2.14-26
  posh 0.10.1
  zsh 4.3.15-1
  zsh-beta 4.3.15-dev-0+20120108-1

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages zsh depends on:
ii  libc6      2.13-26
ii  libcap2    1:2.22-1
ii  libtinfo5  5.9-4

Versions of packages zsh recommends:
ii  libc6         2.13-26
ii  libncursesw5  5.9-4
ii  libpcre3      8.12-4

Versions of packages zsh suggests:
ii  zsh-doc  4.3.15-1

-- no debconf information





More information about the Pkg-zsh-devel mailing list