From: Eon S. Jeon <esjeon@hyunmu.am>
Date: Tue, 17 Dec 2013 17:45:38 +0000 (-0500)
Subject: Prevent resizing stdin
X-Git-Url: https://git.owens.tech/wrapped.html/wrapped.html/git?a=commitdiff_plain;h=d60ee7337b5f378d8858ef3774c5552d2c8e54fa;p=st.git

Prevent resizing stdin

This fixes a bug that the parent tty gets resized whenever you launch
st through command line.

The problem was that ioctl was resizing cmdfd before it gets
initialized in ttynew. Since cmdfd is a global variable, its initial
value is 0, and consequently stdin was being resized.
---

diff --git a/st.c b/st.c
index f883ac1..4fb3311 100644
--- a/st.c
+++ b/st.c
@@ -3667,11 +3667,11 @@ run(void) {
 		}
 	}
 
+	ttynew();
 	if(!xw.isfixed)
 		cresize(w, h);
 	else
 		cresize(xw.fw, xw.fh);
-	ttynew();
 
 	gettimeofday(&lastblink, NULL);
 	gettimeofday(&last, NULL);