X-Git-Url: https://git.xinqibao.xyz/st.git/blobdiff_plain/bf8c71e42937b623f76ced22c9557f87e3d945da..20d53cebc122829449524ef339ce44e13c6e85ec:/st.c?ds=inline diff --git a/st.c b/st.c index bd8b815..bcf74b3 100644 --- a/st.c +++ b/st.c @@ -1430,8 +1430,7 @@ ttynew(void) if (opt_line) { if ((cmdfd = open(opt_line, O_RDWR)) < 0) die("open line failed: %s\n", strerror(errno)); - close(0); - dup(cmdfd); + dup2(cmdfd, 0); stty(); return; }