mirror of
				git://git.suckless.org/st
				synced 2025-10-31 03:27:32 +00:00 
			
		
		
		
	Compare commits
	
		
			8 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 6e97047474 | ||
|  | 5a4666c19e | ||
|  | d6c431859c | ||
|  | f114bcedd1 | ||
|  | 98610fcd37 | ||
|  | 6009e6e25b | ||
|  | a0274bc20e | ||
|  | 5dbcca4926 | 
| @ -1,5 +1,5 @@ | |||||||
| # st version
 | # st version
 | ||||||
| VERSION = 0.9.2 | VERSION = 0.9.3 | ||||||
| 
 | 
 | ||||||
| # Customize below to fit your system
 | # Customize below to fit your system
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										50
									
								
								st.c
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								st.c
									
									
									
									
									
								
							| @ -1132,6 +1132,7 @@ csiparse(void) | |||||||
| { | { | ||||||
| 	char *p = csiescseq.buf, *np; | 	char *p = csiescseq.buf, *np; | ||||||
| 	long int v; | 	long int v; | ||||||
|  | 	int sep = ';'; /* colon or semi-colon, but not both */ | ||||||
| 
 | 
 | ||||||
| 	csiescseq.narg = 0; | 	csiescseq.narg = 0; | ||||||
| 	if (*p == '?') { | 	if (*p == '?') { | ||||||
| @ -1149,7 +1150,9 @@ csiparse(void) | |||||||
| 			v = -1; | 			v = -1; | ||||||
| 		csiescseq.arg[csiescseq.narg++] = v; | 		csiescseq.arg[csiescseq.narg++] = v; | ||||||
| 		p = np; | 		p = np; | ||||||
| 		if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ) | 		if (sep == ';' && *p == ':') | ||||||
|  | 			sep = ':'; /* allow override to colon once */ | ||||||
|  | 		if (*p != sep || csiescseq.narg == ESC_ARG_SIZ) | ||||||
| 			break; | 			break; | ||||||
| 		p++; | 		p++; | ||||||
| 	} | 	} | ||||||
| @ -1417,16 +1420,22 @@ tsetattr(const int *attr, int l) | |||||||
| 			if ((idx = tdefcolor(attr, &i, l)) >= 0) | 			if ((idx = tdefcolor(attr, &i, l)) >= 0) | ||||||
| 				term.c.attr.fg = idx; | 				term.c.attr.fg = idx; | ||||||
| 			break; | 			break; | ||||||
| 		case 39: | 		case 39: /* set foreground color to default */ | ||||||
| 			term.c.attr.fg = defaultfg; | 			term.c.attr.fg = defaultfg; | ||||||
| 			break; | 			break; | ||||||
| 		case 48: | 		case 48: | ||||||
| 			if ((idx = tdefcolor(attr, &i, l)) >= 0) | 			if ((idx = tdefcolor(attr, &i, l)) >= 0) | ||||||
| 				term.c.attr.bg = idx; | 				term.c.attr.bg = idx; | ||||||
| 			break; | 			break; | ||||||
| 		case 49: | 		case 49: /* set background color to default */ | ||||||
| 			term.c.attr.bg = defaultbg; | 			term.c.attr.bg = defaultbg; | ||||||
| 			break; | 			break; | ||||||
|  | 		case 58: | ||||||
|  | 			/* This starts a sequence to change the color of
 | ||||||
|  | 			 * "underline" pixels. We don't support that and | ||||||
|  | 			 * instead eat up a following "5;n" or "2;r;g;b". */ | ||||||
|  | 			tdefcolor(attr, &i, l); | ||||||
|  | 			break; | ||||||
| 		default: | 		default: | ||||||
| 			if (BETWEEN(attr[i], 30, 37)) { | 			if (BETWEEN(attr[i], 30, 37)) { | ||||||
| 				term.c.attr.fg = attr[i] - 30; | 				term.c.attr.fg = attr[i] - 30; | ||||||
| @ -1523,7 +1532,7 @@ tsetmode(int priv, int set, const int *args, int narg) | |||||||
| 			case 1006: /* 1006: extended reporting mode */ | 			case 1006: /* 1006: extended reporting mode */ | ||||||
| 				xsetmode(set, MODE_MOUSESGR); | 				xsetmode(set, MODE_MOUSESGR); | ||||||
| 				break; | 				break; | ||||||
| 			case 1034: | 			case 1034: /* 1034: enable 8-bit mode for keyboard input */ | ||||||
| 				xsetmode(set, MODE_8BIT); | 				xsetmode(set, MODE_8BIT); | ||||||
| 				break; | 				break; | ||||||
| 			case 1049: /* swap screen & set/restore cursor as xterm */ | 			case 1049: /* swap screen & set/restore cursor as xterm */ | ||||||
| @ -1531,8 +1540,8 @@ tsetmode(int priv, int set, const int *args, int narg) | |||||||
| 					break; | 					break; | ||||||
| 				tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); | 				tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); | ||||||
| 				/* FALLTHROUGH */ | 				/* FALLTHROUGH */ | ||||||
| 			case 47: /* swap screen */ | 			case 47: /* swap screen buffer */ | ||||||
| 			case 1047: | 			case 1047: /* swap screen buffer */ | ||||||
| 				if (!allowaltscreen) | 				if (!allowaltscreen) | ||||||
| 					break; | 					break; | ||||||
| 				alt = IS_SET(MODE_ALTSCREEN); | 				alt = IS_SET(MODE_ALTSCREEN); | ||||||
| @ -1545,7 +1554,7 @@ tsetmode(int priv, int set, const int *args, int narg) | |||||||
| 				if (*args != 1049) | 				if (*args != 1049) | ||||||
| 					break; | 					break; | ||||||
| 				/* FALLTHROUGH */ | 				/* FALLTHROUGH */ | ||||||
| 			case 1048: | 			case 1048: /* save/restore cursor (like DECSC/DECRC) */ | ||||||
| 				tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); | 				tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); | ||||||
| 				break; | 				break; | ||||||
| 			case 2004: /* 2004: bracketed paste mode */ | 			case 2004: /* 2004: bracketed paste mode */ | ||||||
| @ -1702,7 +1711,7 @@ csihandle(void) | |||||||
| 			} | 			} | ||||||
| 			break; | 			break; | ||||||
| 		case 1: /* above */ | 		case 1: /* above */ | ||||||
| 			if (term.c.y > 1) | 			if (term.c.y > 0) | ||||||
| 				tclearregion(0, 0, term.col-1, term.c.y-1); | 				tclearregion(0, 0, term.col-1, term.c.y-1); | ||||||
| 			tclearregion(0, term.c.y, term.c.x, term.c.y); | 			tclearregion(0, term.c.y, term.c.x, term.c.y); | ||||||
| 			break; | 			break; | ||||||
| @ -1798,7 +1807,11 @@ csihandle(void) | |||||||
| 		tcursor(CURSOR_SAVE); | 		tcursor(CURSOR_SAVE); | ||||||
| 		break; | 		break; | ||||||
| 	case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */ | 	case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */ | ||||||
|  | 		if (csiescseq.priv) { | ||||||
|  | 			goto unknown; | ||||||
|  | 		} else { | ||||||
| 			tcursor(CURSOR_LOAD); | 			tcursor(CURSOR_LOAD); | ||||||
|  | 		} | ||||||
| 		break; | 		break; | ||||||
| 	case ' ': | 	case ' ': | ||||||
| 		switch (csiescseq.mode[1]) { | 		switch (csiescseq.mode[1]) { | ||||||
| @ -1900,7 +1913,7 @@ strhandle(void) | |||||||
| 			if (narg > 1) | 			if (narg > 1) | ||||||
| 				xsettitle(strescseq.args[1]); | 				xsettitle(strescseq.args[1]); | ||||||
| 			return; | 			return; | ||||||
| 		case 52: | 		case 52: /* manipulate selection data */ | ||||||
| 			if (narg > 2 && allowwindowops) { | 			if (narg > 2 && allowwindowops) { | ||||||
| 				dec = base64dec(strescseq.args[2]); | 				dec = base64dec(strescseq.args[2]); | ||||||
| 				if (dec) { | 				if (dec) { | ||||||
| @ -1911,9 +1924,9 @@ strhandle(void) | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			return; | 			return; | ||||||
| 		case 10: | 		case 10: /* set dynamic VT100 text foreground color */ | ||||||
| 		case 11: | 		case 11: /* set dynamic VT100 text background color */ | ||||||
| 		case 12: | 		case 12: /* set dynamic text cursor color */ | ||||||
| 			if (narg < 2) | 			if (narg < 2) | ||||||
| 				break; | 				break; | ||||||
| 			p = strescseq.args[1]; | 			p = strescseq.args[1]; | ||||||
| @ -1954,6 +1967,19 @@ strhandle(void) | |||||||
| 				tfulldirt(); | 				tfulldirt(); | ||||||
| 			} | 			} | ||||||
| 			return; | 			return; | ||||||
|  | 		case 110: /* reset dynamic VT100 text foreground color */ | ||||||
|  | 		case 111: /* reset dynamic VT100 text background color */ | ||||||
|  | 		case 112: /* reset dynamic text cursor color */ | ||||||
|  | 			if (narg != 1) | ||||||
|  | 				break; | ||||||
|  | 			if ((j = par - 110) < 0 || j >= LEN(osc_table)) | ||||||
|  | 				break; /* shouldn't be possible */ | ||||||
|  | 			if (xsetcolorname(osc_table[j].idx, NULL)) { | ||||||
|  | 				fprintf(stderr, "erresc: %s color not found\n", osc_table[j].str); | ||||||
|  | 			} else { | ||||||
|  | 				tfulldirt(); | ||||||
|  | 			} | ||||||
|  | 			return; | ||||||
| 		} | 		} | ||||||
| 		break; | 		break; | ||||||
| 	case 'k': /* old title set compatibility */ | 	case 'k': /* old title set compatibility */ | ||||||
|  | |||||||
							
								
								
									
										11
									
								
								x.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								x.c
									
									
									
									
									
								
							| @ -1131,7 +1131,7 @@ xinit(int cols, int rows) | |||||||
| { | { | ||||||
| 	XGCValues gcvalues; | 	XGCValues gcvalues; | ||||||
| 	Cursor cursor; | 	Cursor cursor; | ||||||
| 	Window parent; | 	Window parent, root; | ||||||
| 	pid_t thispid = getpid(); | 	pid_t thispid = getpid(); | ||||||
| 	XColor xmousefg, xmousebg; | 	XColor xmousefg, xmousebg; | ||||||
| 
 | 
 | ||||||
| @ -1168,16 +1168,19 @@ xinit(int cols, int rows) | |||||||
| 		| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; | 		| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; | ||||||
| 	xw.attrs.colormap = xw.cmap; | 	xw.attrs.colormap = xw.cmap; | ||||||
| 
 | 
 | ||||||
|  | 	root = XRootWindow(xw.dpy, xw.scr); | ||||||
| 	if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) | 	if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) | ||||||
| 		parent = XRootWindow(xw.dpy, xw.scr); | 		parent = root; | ||||||
| 	xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, | 	xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t, | ||||||
| 			win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, | 			win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, | ||||||
| 			xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity | 			xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity | ||||||
| 			| CWEventMask | CWColormap, &xw.attrs); | 			| CWEventMask | CWColormap, &xw.attrs); | ||||||
|  | 	if (parent != root) | ||||||
|  | 		XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t); | ||||||
| 
 | 
 | ||||||
| 	memset(&gcvalues, 0, sizeof(gcvalues)); | 	memset(&gcvalues, 0, sizeof(gcvalues)); | ||||||
| 	gcvalues.graphics_exposures = False; | 	gcvalues.graphics_exposures = False; | ||||||
| 	dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, | 	dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures, | ||||||
| 			&gcvalues); | 			&gcvalues); | ||||||
| 	xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, | 	xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, | ||||||
| 			DefaultDepth(xw.dpy, xw.scr)); | 			DefaultDepth(xw.dpy, xw.scr)); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user