diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-05-15 15:50:57 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-05-15 15:50:57 +0000 |
commit | 02e0a4755f47f1eb720d5b81b37cc8e3d3a453ac (patch) | |
tree | d64ad703ab3c1ed514b2a177ed608a637a39e8c0 /Src/Modules | |
parent | 5e373b83a53c739fc6f53a632a1280179723b820 (diff) | |
download | zsh-02e0a4755f47f1eb720d5b81b37cc8e3d3a453ac.tar.gz zsh-02e0a4755f47f1eb720d5b81b37cc8e3d3a453ac.tar.xz zsh-02e0a4755f47f1eb720d5b81b37cc8e3d3a453ac.zip |
25040: zpty should display context information more like eval
Diffstat (limited to 'Src/Modules')
-rw-r--r-- | Src/Modules/zpty.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c index 9bd14985e..4076a5b7e 100644 --- a/Src/Modules/zpty.c +++ b/Src/Modules/zpty.c @@ -290,22 +290,34 @@ static int newptycmd(char *nam, char *pname, char **args, int echo, int nblock) { Ptycmd p; - int master, slave, pid; + int master, slave, pid, oineval = ineval; + char *oscriptname = scriptname; Eprog prog; + /* code borrowed from bin_eval() */ + ineval = !isset(EVALLINENO); + if (!ineval) + scriptname = "(zpty)"; + prog = parse_string(zjoin(args, ' ', 1)); if (!prog) { errflag = 0; + scriptname = oscriptname; + ineval = oineval; return 1; } if (get_pty(1, &master)) { zwarnnam(nam, "can't open pseudo terminal: %e", errno); + scriptname = oscriptname; + ineval = oineval; return 1; } if ((pid = fork()) == -1) { zwarnnam(nam, "can't create pty command %s: %e", pname, errno); close(master); + scriptname = oscriptname; + ineval = oineval; return 1; } else if (!pid) { /* This code copied from the clone module, except for getting * @@ -406,6 +418,8 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock) if (nblock) ptynonblock(master); + scriptname = oscriptname; + ineval = oineval; return 0; } |