X-Git-Url: https://git.xinqibao.xyz/st.git/blobdiff_plain/8211e36d281990a39db1853bcd454ac59e53d521..8304d4f0599b1be2226c28c553547070658d4af3:/st.c?ds=inline

diff --git a/st.c b/st.c
index 5d4054f..8c42a9c 100644
--- a/st.c
+++ b/st.c
@@ -2153,6 +2153,7 @@ tcontrolcode(uchar ascii)
 		return;
 	case '\032': /* SUB */
 		tsetchar('?', &term.c.attr, term.c.x, term.c.y);
+		/* FALLTHROUGH */
 	case '\030': /* CAN */
 		csireset();
 		break;
@@ -2307,7 +2308,7 @@ tputc(Rune u)
 	Glyph *gp;
 
 	control = ISCONTROL(u);
-	if (!IS_SET(MODE_UTF8 | MODE_SIXEL)) {
+	if (u < 127 || !IS_SET(MODE_UTF8 | MODE_SIXEL)) {
 		c[0] = u;
 		width = len = 1;
 	} else {
@@ -2411,7 +2412,7 @@ check_control_code:
 		 */
 		return;
 	}
-	if (sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y))
+	if (selected(term.c.x, term.c.y))
 		selclear();
 
 	gp = &term.line[term.c.y][term.c.x];