diff options
| author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2020-05-30 21:50:54 +0200 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2020-05-30 22:05:17 +0200 |
| commit | 0f8b40652bca0670f1f0bda069bbc55f8b5e364d (patch) | |
| tree | 24ac63a4c641a4e3076781bf08013120610ec231 /FAQ | |
| parent | tiny style fix (diff) | |
| download | st-0f8b40652bca0670f1f0bda069bbc55f8b5e364d.tar.gz st-0f8b40652bca0670f1f0bda069bbc55f8b5e364d.zip | |
FAQ: add some details about the w3m img hack
... and an example patch to switch from double-buffering to a single buffer.
Diffstat (limited to '')
| -rw-r--r-- | FAQ | 59 |
1 files changed, 54 insertions, 5 deletions
| @@ -2,12 +2,14 @@ | |||
| 2 | 2 | ||
| 3 | Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task. | 3 | Use 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 | ||
| 7 | It means that st doesn’t have any terminfo entry on your system. Chances are | 8 | It means that st doesn’t have any terminfo entry on your system. Chances are |
| 8 | you did not `make install`. If you just want to test it without installing it, | 9 | you did not `make install`. If you just want to test it without installing it, |
| 9 | you can manually run `tic -sx st.info`. | 10 | you 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 | ||
| 28 | You can add the absolute patch of both programs in your config.h | 32 | You can add the absolute patch of both programs in your config.h |
| 29 | file. You only have to modify the value of utmp and scroll variables. | 33 | file. 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 | ||
| 33 | Taken from the terminfo manpage: | 38 | Taken from the terminfo manpage: |
| @@ -83,12 +88,14 @@ If you are using zsh, then read the zsh FAQ | |||
| 83 | 88 | ||
| 84 | Putting these lines into your .zshrc will fix the problems. | 89 | Putting 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 | ||
| 88 | St supports meta in 8bit mode, but the default terminfo entry doesn't | 94 | St supports meta in 8bit mode, but the default terminfo entry doesn't |
| 89 | use this capability. If you want it, you have to use the 'st-meta' value | 95 | use this capability. If you want it, you have to use the 'st-meta' value |
| 90 | in TERM. | 96 | in TERM. |
| 91 | 97 | ||
| 98 | |||
| 92 | ## I cannot compile st in OpenBSD | 99 | ## I cannot compile st in OpenBSD |
| 93 | 100 | ||
| 94 | OpenBSD lacks librt, despite it being mandatory in POSIX | 101 | OpenBSD 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 | |||
| 97 | st will compile without any loss of functionality, because all the functions are | 104 | st will compile without any loss of functionality, because all the functions are |
| 98 | included in libc on this platform. | 105 | included in libc on this platform. |
| 99 | 106 | ||
| 107 | |||
| 100 | ## The Backspace Case | 108 | ## The Backspace Case |
| 101 | 109 | ||
| 102 | St is emulating the Linux way of handling backspace being delete and delete being | 110 | St 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 | ||
| 163 | Apply [1]. | 172 | Apply [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 | ||
| 169 | This 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? |
| 170 | window. It also relies on a very specific way the terminal draws it's contents. | 178 | |
| 179 | w3mimg uses a hack that draws an image on top of the terminal emulator Drawable | ||
| 180 | window. The hack relies on the terminal to use a single buffer to draw its | ||
| 181 | contents directly. | ||
| 182 | |||
| 183 | st uses double-buffered drawing so the image is quickly replaced and may show a | ||
| 184 | short flicker effect. | ||
| 185 | |||
| 186 | Below is a patch example to change st double-buffering to a single Drawable | ||
| 187 | buffer. | ||
| 188 | |||
| 189 | diff --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 | ||
| 172 | A more proper (but limited way) would be using sixels. Which st doesn't | ||
| 173 | support. | ||
| 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 | ||
