zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Using "source" in a function breaks job control
Date: Wed, 22 Apr 2015 20:11:28 +0200	[thread overview]
Message-ID: <5537E450.9060205@thequod.de> (raw)

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


             reply	other threads:[~2015-04-22 18:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 18:11 Daniel Hahler [this message]
2015-04-22 20:41 ` Peter Stephenson
2015-04-22 21:26 ` Peter Stephenson
2015-04-23  4:55   ` Bart Schaefer
2015-04-23 20:13     ` Peter Stephenson
2015-04-24  6:22       ` Bart Schaefer
2015-04-24 15:25         ` Peter Stephenson
2015-04-24 15:43           ` Peter Stephenson
2015-04-24 16:21           ` Bart Schaefer
2015-04-27 17:29             ` Peter Stephenson
2015-04-28 10:18             ` Peter Stephenson
2015-04-28 15:57               ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5537E450.9060205@thequod.de \
    --to=genml+zsh-workers@thequod.de \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).