Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Using "source" in a function breaks job control
- X-seq: zsh-workers 34947
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Using "source" in a function breaks job control
- Date: Wed, 22 Apr 2015 20:11:28 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= content-transfer-encoding:content-type:content-type:subject :subject:mime-version:user-agent:from:from:date:date:message-id :received:received; s=postfix2; t=1429726289; bh=pDaQmBYqOLKz5wU Eeww9UQJ9tsI/RRfBNnXxOzGMwS4=; b=VIqdHSg73Yae7r0Ber1XwobK2ZteafJ IRWew6f8MbOtP2BzijUXXlNKw72LSL18glAg5SgkqKvxHPigVEAZdPDWA5LD/mB4 Rv5DXTmUupk0Lkqdf2DqDHp8neeVKcin4888pbqeCzzME3XTTM2s9VxbQiiMHMhL HDhjB+l53d/8=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've noticed that when using "source" (with a file that has at least one expression)
in a function, it will cause job control to not work as expected anymore.
TEST CASE:
1. echo true > /tmp/foo.zsh
2. vi() { source /tmp/foo.zsh; vim -u NONE -N; }
3. Run "vi"
4. In Vim, press Ctrl-Z to put it into the background.
5. Execute "fg".
It should bring back "vim", but does not.
OUTPUT:
% vi
[1] + 23415 running
⎯⎯⎯[~] es:148 (SIGSTOP) jobs:1s
% fg
[1] + 23415 continued
⎯⎯⎯[~] es:148 (SIGSTOP)
%
The PID 23415 refers to a "zsh" subprocess:
| |-zsh,23316
| | |-vim,23414 -u NONE -N
| | `-zsh,23415
Is this behavior expected?
Why is there a new subprocess being created?
Regards,
Daniel.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iD8DBQFVN+RQfAK/hT/mPgARAohaAKDn9uawn58BjsxIhdDTfRG33A7H3QCg+che
6S9jXhz0oMFCzMTr30fY3Ew=
=4nNo
-----END PGP SIGNATURE-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author