diff options
author | John Ankarström <john@ankarstrom.se> | 2021-06-07 16:36:05 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-06-08 01:50:54 +0200 |
commit | 7aaf4f2423e2bcabce508e91255de673db50b728 (patch) | |
tree | cfdfc247185d7a97fce6f96110fb964f00b766fe /jobs.c | |
parent | 60b250c267e9ce69f428fd2f0f56a4b1a54f2004 (diff) | |
download | ksh-master.tar.gz |
ksh will write lines to write-file containing information about
the status of the shell:
after prompt: empty line
after command entry: "cmd" followed by command
after cwd change: "cwd" followed by new cwd
fg is handled specially, printing a new "cmd" line with the original
command associated with the job.
Diffstat (limited to 'jobs.c')
-rw-r--r-- | jobs.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -840,6 +840,8 @@ j_resume(cp, bg) shprintf("[%d] ", j->job); running = 0; + if (writefd) + dprintf(writefd, "cmd"); for (p = j->proc_list; p != (Proc *) 0; p = p->next) { if (p->state == PSTOPPED) { p->state = PRUNNING; @@ -847,9 +849,14 @@ j_resume(cp, bg) running = 1; } shprintf("%s%s", p->command, p->next ? "| " : null); + if (writefd) + dprintf(writefd, "%s%s", + p->command, p->next ? "| " : null); } shprintf("%s", newline); shf_flush(shl_stdout); + if (writefd) + dprintf(writefd, "\n"); if (running) j->state = PRUNNING; |