From 65977417e7cc5919f7c9787f97a528e8c24d2423 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 30 Jun 2016 00:45:37 +0200 Subject: rc: write /dev/wdir after printing the prompt, not after executing "cd" command --- sys/src/cmd/rc/lex.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/src/cmd/rc/lex.c') diff --git a/sys/src/cmd/rc/lex.c b/sys/src/cmd/rc/lex.c index fa364f18d..662c1970a 100644 --- a/sys/src/cmd/rc/lex.c +++ b/sys/src/cmd/rc/lex.c @@ -92,6 +92,16 @@ pprompt(void) if(runq->iflag){ pstr(err, promptstr); flush(err); + if(newwdir){ + char dir[4096]; + int fd; + if((fd=open("/dev/wdir", OWRITE))>=0){ + getwd(dir, sizeof(dir)); + write(fd, dir, strlen(dir)); + close(fd); + } + newwdir = 0; + } prompt = vlook("prompt"); if(prompt->val && prompt->val->next) promptstr = prompt->val->next->word; -- cgit v1.2.3