1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +01:00

try to make the -t option of zpty smarter (13462)

This commit is contained in:
Sven Wischnowsky 2001-02-13 13:14:45 +00:00
parent 90b07817db
commit 326d682510
2 changed files with 14 additions and 5 deletions

@ -1,5 +1,8 @@
2001-02-13 Sven Wischnowsky <wischnow@zsh.org> 2001-02-13 Sven Wischnowsky <wischnow@zsh.org>
* 13462: Src/Modules/zpty.c: try to make the -t option of zpty
smarter
* 13459: Completion/Core/_path_files: wehn using glob_complete, * 13459: Completion/Core/_path_files: wehn using glob_complete,
don't treat everything starting with a tilde as a pattern don't treat everything starting with a tilde as a pattern

@ -430,13 +430,19 @@ deleteallptycmds(void)
static void static void
checkptycmd(Ptycmd cmd) checkptycmd(Ptycmd cmd)
{ {
if (cmd->read != -1) char c;
int r;
if (cmd->read != -1 || cmd->fin)
return;
if ((r = read(cmd->fd, &c, 1)) < 0) {
if (kill(cmd->pid, 0) < 0) {
cmd->fin = 1;
zclose(cmd->fd);
}
return; return;
if (!read_poll(cmd->fd, &cmd->read, 0) &&
kill(cmd->pid, 0) < 0) {
cmd->fin = 1;
zclose(cmd->fd);
} }
if (r) cmd->read = (int) c;
} }
static int static int