X-Git-Url: https://git.xinqibao.xyz/st.git/blobdiff_plain/f2da43a0b66f76532ebef5ed2b2c9135aca771a5..122ed577027ccbb85b2fe6a0f9449035fe074a9e:/st.c diff --git a/st.c b/st.c index fd5e0fd..a4575f4 100644 --- a/st.c +++ b/st.c @@ -551,7 +551,6 @@ bpress(XEvent *e) { sel.mode = 1; sel.ex = sel.bx = X2COL(e->xbutton.x); sel.ey = sel.by = Y2ROW(e->xbutton.y); - draw(); } } @@ -801,9 +800,15 @@ ttynew(void) { close(s); cmdfd = m; signal(SIGCHLD, sigchld); - if(opt_io && !(fileio = fopen(opt_io, "w"))) { - fprintf(stderr, "Error opening %s:%s\n", - opt_io, strerror(errno)); + if(opt_io) { + if(!strcmp(opt_io, "-")) { + fileio = stdout; + } else { + if(!(fileio = fopen(opt_io, "w"))) { + fprintf(stderr, "Error opening %s:%s\n", + opt_io, strerror(errno)); + } + } } } }