From ead340a66039096c7b4bf12dcd65e189769c6653 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Mon, 18 Oct 2021 17:51:11 -0700 Subject: feat(rc): job control prototype working for basic commands --- sys/cmd/rc/input.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/cmd/rc/input.c') diff --git a/sys/cmd/rc/input.c b/sys/cmd/rc/input.c index cf05382..4c6b37f 100644 --- a/sys/cmd/rc/input.c +++ b/sys/cmd/rc/input.c @@ -85,7 +85,7 @@ enterraw(int fd) { struct termios raw; - if(!isatty(0)) + if(!shell.interactive) goto fatal; if(!mode.defer) { @@ -995,7 +995,7 @@ notty(void) for(;;){ c = fgetc(stdin); - put(&shell->cmd.io, c); + put(&proc->cmd.io, c); } } @@ -1019,17 +1019,17 @@ readline(char *prompt) int n; // reset the command buffer - shell->cmd.io->e = shell->cmd.io->b = shell->cmd.io->buf; + proc->cmd.io->e = proc->cmd.io->b = proc->cmd.io->buf; - if(!isatty(0)) + if(!shell.interactive) return notty(); - if((n = raw(shell->cmd.io->e, shell->cmd.io->cap-1, prompt)) == -1) + if((n = raw(proc->cmd.io->e, proc->cmd.io->cap-1, prompt)) == -1) return 0; - shell->cmd.io->e += n; + proc->cmd.io->e += n; /* insert a newline character at the end */ - put(&shell->cmd.io, '\n'); + put(&proc->cmd.io, '\n'); printf("\n"); return 1; -- cgit v1.2.1