Skip to content

Commit

Permalink
Enhance user experience
Browse files Browse the repository at this point in the history
The endline can be correctly displayed in the web browser.

The commands from the web can be displayed in the terminal and the
redundant prompt will be removed.
  • Loading branch information
paul90317 committed Mar 12, 2024
1 parent b62b9e9 commit bc5d894
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion console.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,12 @@ static int cmd_select(int nfds,
"</head><body><table>\n";
web_send(web_connfd, buffer);

if (p)
if (p) {
printf("\rweb> %s\n", p);
fflush(stdout);
interpret_cmd(p);
}

free(p);
close(web_connfd);
}
Expand Down
4 changes: 1 addition & 3 deletions report.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ void report(int level, char *fmt, ...)
va_end(ap);
}
if (web_connfd) {
int len = strlen(buffer);
buffer[len] = '\n';
buffer[len + 1] = '\0';
strcat(buffer, "<br/>");
web_send(web_connfd, buffer);
}
}
Expand Down

0 comments on commit bc5d894

Please sign in to comment.