Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Using "source" in a function breaks job control



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