aboutsummaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c3
1 files changed, 1 insertions, 2 deletions
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;
}
remember that computers suck.