aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2020-05-30 21:50:54 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2020-05-30 22:05:17 +0200
commit0f8b40652bca0670f1f0bda069bbc55f8b5e364d (patch)
tree24ac63a4c641a4e3076781bf08013120610ec231
parente6e2c6199f102f1459b53717050eee27832f4f87 (diff)
downloadst-patched-0f8b40652bca0670f1f0bda069bbc55f8b5e364d.tar.bz2
st-patched-0f8b40652bca0670f1f0bda069bbc55f8b5e364d.tar.xz
st-patched-0f8b40652bca0670f1f0bda069bbc55f8b5e364d.zip
FAQ: add some details about the w3m img hack
... and an example patch to switch from double-buffering to a single buffer.
-rw-r--r--FAQ59
1 files changed, 54 insertions, 5 deletions
diff --git a/FAQ b/FAQ
index 85534a4..fb40264 100644
--- a/FAQ
+++ b/FAQ
@@ -2,12 +2,14 @@
2 2
3Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task. 3Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task.
4 4
5
5## Some _random program_ complains that st is unknown/not recognised/unsupported/whatever! 6## Some _random program_ complains that st is unknown/not recognised/unsupported/whatever!
6 7
7It means that st doesn’t have any terminfo entry on your system. Chances are 8It means that st doesn’t have any terminfo entry on your system. Chances are
8you did not `make install`. If you just want to test it without installing it, 9you did not `make install`. If you just want to test it without installing it,
9you can manually run `tic -sx st.info`. 10you can manually run `tic -sx st.info`.
10 11
12
11## Nothing works, and nothing is said about an unknown terminal! 13## Nothing works, and nothing is said about an unknown terminal!
12 14
13* Some programs just assume they’re running in xterm i.e. they don’t rely on 15* Some programs just assume they’re running in xterm i.e. they don’t rely on
@@ -15,6 +17,7 @@ you can manually run `tic -sx st.info`.
15* Some programs don’t complain about the lacking st description and default to 17* Some programs don’t complain about the lacking st description and default to
16 another terminal. In that case see the question about terminfo. 18 another terminal. In that case see the question about terminfo.
17 19
20
18## How do I scroll back up? 21## How do I scroll back up?
19 22
20* Using a terminal multiplexer. 23* Using a terminal multiplexer.
@@ -23,11 +26,13 @@ you can manually run `tic -sx st.info`.
23* Using the excellent tool of [scroll](https://git.suckless.org/scroll/). 26* Using the excellent tool of [scroll](https://git.suckless.org/scroll/).
24* Using the scrollback [patch](https://st.suckless.org/patches/scrollback/). 27* Using the scrollback [patch](https://st.suckless.org/patches/scrollback/).
25 28
29
26## I would like to have utmp and/or scroll functionality by default 30## I would like to have utmp and/or scroll functionality by default
27 31
28You can add the absolute patch of both programs in your config.h 32You can add the absolute patch of both programs in your config.h
29file. You only have to modify the value of utmp and scroll variables. 33file. You only have to modify the value of utmp and scroll variables.
30 34
35
31## Why doesn't the Del key work in some programs? 36## Why doesn't the Del key work in some programs?
32 37
33Taken from the terminfo manpage: 38Taken from the terminfo manpage:
@@ -83,12 +88,14 @@ If you are using zsh, then read the zsh FAQ
83 88
84Putting these lines into your .zshrc will fix the problems. 89Putting these lines into your .zshrc will fix the problems.
85 90
91
86## How can I use meta in 8bit mode? 92## How can I use meta in 8bit mode?
87 93
88St supports meta in 8bit mode, but the default terminfo entry doesn't 94St supports meta in 8bit mode, but the default terminfo entry doesn't
89use this capability. If you want it, you have to use the 'st-meta' value 95use this capability. If you want it, you have to use the 'st-meta' value
90in TERM. 96in TERM.
91 97
98
92## I cannot compile st in OpenBSD 99## I cannot compile st in OpenBSD
93 100
94OpenBSD lacks librt, despite it being mandatory in POSIX 101OpenBSD lacks librt, despite it being mandatory in POSIX
@@ -97,6 +104,7 @@ If you want to compile st for OpenBSD you have to remove -lrt from config.mk, an
97st will compile without any loss of functionality, because all the functions are 104st will compile without any loss of functionality, because all the functions are
98included in libc on this platform. 105included in libc on this platform.
99 106
107
100## The Backspace Case 108## The Backspace Case
101 109
102St is emulating the Linux way of handling backspace being delete and delete being 110St is emulating the Linux way of handling backspace being delete and delete being
@@ -158,19 +166,60 @@ terminal users wants its backspace to be how he feels it:
158 [1] http://www.ibb.net/~anne/keyboard.html 166 [1] http://www.ibb.net/~anne/keyboard.html
159 [2] http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html 167 [2] http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html
160 168
169
161## But I really want the old grumpy behaviour of my terminal 170## But I really want the old grumpy behaviour of my terminal
162 171
163Apply [1]. 172Apply [1].
164 173
165[1] https://st.suckless.org/patches/delkey 174[1] https://st.suckless.org/patches/delkey
166 175
167## Why do images not work in st (in programs such as w3m)?
168 176
169This is a terrible hack that overdraws an image on top of the terminal emulator 177## Why do images not work in st using the w3m image hack?
170window. It also relies on a very specific way the terminal draws it's contents. 178
179w3mimg uses a hack that draws an image on top of the terminal emulator Drawable
180window. The hack relies on the terminal to use a single buffer to draw its
181contents directly.
182
183st uses double-buffered drawing so the image is quickly replaced and may show a
184short flicker effect.
185
186Below is a patch example to change st double-buffering to a single Drawable
187buffer.
188
189diff --git a/x.c b/x.c
190--- a/x.c
191+++ b/x.c
192@@ -561,10 +561,6 @@ xresize(int col, int row)
193 win.tw = MAX(1, col * win.cw);
194 win.th = MAX(1, row * win.ch);
195
196- XFreePixmap(xw.dpy, xw.buf);
197- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
198- DefaultDepth(xw.dpy, xw.scr));
199- XftDrawChange(xw.draw, xw.buf);
200 xclear(0, 0, win.w, win.h);
201 }
202
203@@ -921,8 +917,7 @@ xinit(void)
204 gcvalues.graphics_exposures = False;
205 dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
206 &gcvalues);
207- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
208- DefaultDepth(xw.dpy, xw.scr));
209+ xw.buf = xw.win;
210 XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
211 XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
212
213@@ -1386,8 +1381,6 @@ void
214 draw(void)
215 {
216 drawregion(0, 0, term.col, term.row);
217- XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w,
218- win.h, 0, 0);
219 XSetForeground(xw.dpy, dc.gc,
220 dc.col[IS_SET(MODE_REVERSE)?
221 defaultfg : defaultbg].pixel);
171 222
172A more proper (but limited way) would be using sixels. Which st doesn't
173support.
174 223
175## BadLength X error in Xft when trying to render emoji 224## BadLength X error in Xft when trying to render emoji
176 225