summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rc/lex.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-06-30 00:45:37 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-06-30 00:45:37 +0200
commit65977417e7cc5919f7c9787f97a528e8c24d2423 (patch)
tree5379e98e16d10e44fd30cb45e776f54ff3f953a3 /sys/src/cmd/rc/lex.c
parentd39d1a5303541539f61488317b220c1eb724d7d3 (diff)
rc: write /dev/wdir after printing the prompt, not after executing "cd" command
Diffstat (limited to 'sys/src/cmd/rc/lex.c')
-rw-r--r--sys/src/cmd/rc/lex.c10
1 files changed, 10 insertions, 0 deletions
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;