Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/cmdline/cmdline_os_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ terminal_adjust(struct cmdline *cl)

memcpy(&term, &cl->oldterm, sizeof(term));
term.c_lflag &= ~(ICANON | ECHO | ISIG);
tcsetattr(0, TCSANOW, &term);
tcsetattr(STDIN_FILENO, TCSANOW, &term);

setbuf(stdin, NULL);
}

void
terminal_restore(const struct cmdline *cl)
{
tcsetattr(fileno(stdin), TCSANOW, &cl->oldterm);
tcsetattr(STDIN_FILENO, TCSANOW, &cl->oldterm);
}

ssize_t
Expand Down
3 changes: 1 addition & 2 deletions lib/cmdline/cmdline_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* All rights reserved.
*/

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

Expand Down Expand Up @@ -34,7 +33,7 @@ cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const char *prompt)
{
struct cmdline *cl;

cl = cmdline_new(ctx, prompt, 0, 1);
cl = cmdline_new(ctx, prompt, STDIN_FILENO, STDOUT_FILENO);

if (cl != NULL)
terminal_adjust(cl);
Expand Down