1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-12-15 20:51:27 +01:00

25040: zpty should display context information more like eval

This commit is contained in:
Peter Stephenson 2008-05-15 15:50:57 +00:00
parent 5e373b83a5
commit 02e0a4755f
4 changed files with 22 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2008-05-15 Peter Stephenson <pws@csr.com>
* 25040: Src/builtin.c, Src/utils.c, Src/Modules/zpty.c:
zpty should display context information more like eval.
2008-05-14 Peter Stephenson <pws@csr.com>
* unposted: Completion/Unix/Command/_perforce: also p4 sizes,

View file

@ -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;
}

View file

@ -4681,7 +4681,7 @@ bin_emulate(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func))
/* eval: simple evaluation */
/**/
int ineval;
mod_export int ineval;
/**/
int

View file

@ -33,7 +33,7 @@
/* name of script being sourced */
/**/
char *scriptname;
mod_export char *scriptname;
#ifdef MULTIBYTE_SUPPORT
struct widechar_array {