Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Simplify techo
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
a104a50
..
e510565
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-36,10
+36,6
@@
char *argv0;
#define Glyph Glyph_
#define Font Font_
#define Glyph Glyph_
#define Font Font_
-#define Draw XftDraw *
-#define Colour XftColor
-#define Colourmap Colormap
-#define Rectangle XRectangle
#if defined(__linux)
#include <pty.h>
#if defined(__linux)
#include <pty.h>
@@
-180,6
+176,10
@@
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned long ulong;
typedef unsigned short ushort;
+typedef XftDraw *Draw;
+typedef XftColor Colour;
+typedef Colormap Colourmap;
+
typedef struct {
char c[UTF_SIZ]; /* character code */
ushort mode; /* attribute flags */
typedef struct {
char c[UTF_SIZ]; /* character code */
ushort mode; /* attribute flags */
@@
-1855,7
+1855,10
@@
tsetmode(bool priv, bool set, int *args, int narg) {
MODBIT(term.mode, set, MODE_8BIT);
break;
case 1049: /* swap screen & set/restore cursor as xterm */
MODBIT(term.mode, set, MODE_8BIT);
break;
case 1049: /* swap screen & set/restore cursor as xterm */
+ if (!allowaltscreen)
+ break;
tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
+ /* FALLTHRU */
case 47: /* swap screen */
case 1047:
if (!allowaltscreen)
case 47: /* swap screen */
case 1047:
if (!allowaltscreen)
@@
-2315,10
+2318,7
@@
techo(char *buf, int len) {
for(; len > 0; buf++, len--) {
char c = *buf;
for(; len > 0; buf++, len--) {
char c = *buf;
- if(c == '\033') { /* escape */
- tputc("^", 1);
- tputc("[", 1);
- } else if(c < '\x20') { /* control code */
+ if(c < '\x20') { /* control code */
if(c != '\n' && c != '\r' && c != '\t') {
c |= '\x40';
tputc("^", 1);
if(c != '\n' && c != '\r' && c != '\t') {
c |= '\x40';
tputc("^", 1);
@@
-3089,7
+3089,7
@@
xinit(void) {
xresettitle();
XMapWindow(xw.dpy, xw.win);
xhints();
xresettitle();
XMapWindow(xw.dpy, xw.win);
xhints();
- XSync(xw.dpy,
0
);
+ XSync(xw.dpy,
False
);
}
void
}
void
@@
-3107,7
+3107,7
@@
xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
FcCharSet *fccharset;
Colour *fg, *bg, *temp, revfg, revbg, truefg, truebg;
XRenderColor colfg, colbg;
FcCharSet *fccharset;
Colour *fg, *bg, *temp, revfg, revbg, truefg, truebg;
XRenderColor colfg, colbg;
- Rectangle r;
+
X
Rectangle r;
int oneatatime;
frcflags = FRC_NORMAL;
int oneatatime;
frcflags = FRC_NORMAL;