My own clone of suckless st with custom patches and settings kept in the "custom" branch.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Avi Halachmi (:avih) 1d59091065 auto-sync: draw on idle to avoid flicker/tearing
st could easily tear/flicker with animation or other unattended
output. This commit eliminates most of the tear/flicker.

Before this commit, the display timing had two "modes":

- Interactively, st was waiting fixed `1000/xfps` ms after forwarding
  the kb/mouse event to the application and before drawing.

- Unattended, and specifically with animations, the draw frequency was
  throttled to `actionfps`. Animation at a higher rate would throttle
  and likely tear, and at lower rates it was tearing big frames
  (specifically, when one `read` didn't get a full "frame").

The interactive behavior was decent, but it was impossible to get good
unattended-draw behavior even with carefully chosen configuration.

This commit changes the behavior such that it draws on idle instead of
using fixed latency/frequency. This means that it tries to draw only
when it's very likely that the application has completed its output
(or after some duration without idle), so it mostly succeeds to avoid
tear, flicker, and partial drawing.

The config values minlatency/maxlatency replace xfps/actionfps and
define the range which the algorithm is allowed to wait from the
initial draw-trigger until the actual draw. The range enables the
flexibility to choose when to draw - when least likely to flicker.

It also unifies the interactive and unattended behavior and config
values, which makes the code simpler as well - without sacrificing
latency during interactive use, because typically interactively idle
arrives very quickly, so the wait is typically minlatency.

While it only slighly improves interactive behavior, for animations
and other unattended-drawing it improves greatly, as it effectively
adapts to any [animation] output rate without tearing, throttling,
redundant drawing, or unnecessary delays (sounds impossible, but it
works).
4 years ago
FAQ Update FAQ with the last modifications 4 years ago
LEGACY LEGACY: typo. 12 years ago
LICENSE LICENSE: fix a few years 6 years ago
Makefile Makefile: fix dependencies on config.h 5 years ago
README tic -s -> tic -sx (Treat unknown capabilities as user-defined.) 8 years ago
TODO Remove old TODO entry. 9 years ago
arg.h don't modify argv, use a counter 6 years ago
config.def.h auto-sync: draw on idle to avoid flicker/tearing 4 years ago
config.mk bump version to 0.8.3 4 years ago
st.1 Add support for scroll(1) 4 years ago
st.c replace exit(3) by _exit(2) in signal handler sigchld() 4 years ago
st.h Add support for scroll(1) 4 years ago
st.info Add st-mono terminfo entry 4 years ago
win.h better Input Method Editor (IME) support 5 years ago
x.c auto-sync: draw on idle to avoid flicker/tearing 4 years ago

README

st - simple terminal
--------------------
st is a simple terminal emulator for X which sucks less.


Requirements
------------
In order to build st you need the Xlib header files.


Installation
------------
Edit config.mk to match your local setup (st is installed into
the /usr/local namespace by default).

Afterwards enter the following command to build and install st (if
necessary as root):

    make clean install


Running st
----------
If you did not install st with make clean install, you must compile
the st terminfo entry with the following command:

    tic -sx st.info

See the man page for additional details.

Credits
-------
Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code.