1064 Commits (d5efd256aa3840476579a27293ef1fb92a4b51e7)
 

Author SHA1 Message Date
Lauri Tirkkonen d5efd256aa replace utf8strchr with wcschr 6 years ago
Lauri Tirkkonen 75b4ba4b4b be silent about explicitly unhandled mouse modes 6 years ago
Hiltjo Posthuma ed68fe7dce simplify (greedy) font caching allocating a bit
POSIX says:
"If ptr is a null pointer, realloc() shall be equivalent to malloc() for the
 specified size."
6 years ago
Hiltjo Posthuma 4e0135afec style: remove double empty newlines 6 years ago
magras a8cb8e9454 fix use after free in font caching algorithm
Current font caching algorithm contains a use after free error. A font
removed from `frc` might be still listed in `wx.specbuf`. It will lead
to a crash inside `XftDrawGlyphFontSpec()`.

Steps to reproduce:
$ st -f 'Misc Tamsyn:scalable=false'
$ curl https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt

Of course, result depends on fonts installed on a system and fontconfig.
In my case, I'm getting consistent segfaults with different fonts.

I replaced a fixed array with a simple unbounded buffer with a constant
growth rate. Cache starts with a capacity of 0, gets increments by 16,
and never shrinks. On my machine after `cat UTF-8-demo.txt` buffer
reaches a capacity of 192. During casual use capacity stays at 0.
6 years ago
Ivan Tham e85b6b6466 better Input Method Editor (IME) support
Features:

- Allow input methods swap with hotkey (E.g. left ctrl + left shift).
- Over-the-spot pre-editing style, pre-edit data placed over insertion point.
- Restart IME without segmentation fault.

TODO:

- Automatically pickup IME if st started before IME
6 years ago
Hiltjo Posthuma 75f92eb348 bump version to 0.8.2 6 years ago
Hiltjo Posthuma 3be4cf11d7 config: add Shift+Insert as selpaste() again
This was changed before in:
commit 20f713548d on Wed Jan 25 19:17:38 2017
6 years ago
Paride Legovini 16d98738e7 Let the user specify CPPFLAGS
This complements the work done in d4928ed, allowing the user to specify
the preprocessor flags with the CPPFLAGS environment variable. This is
useful for example to specify preprocessor macros with -D.

CFLAGS could be used instead, but CPPFLAGS is more correct and is expected
to be honored in some cases. For example, the helper scripts to build
Debian packages make use of CPPFLAGS, but the variable is currently
being ignored unless manually appended to CFLAGS.
6 years ago
Paride Legovini e23acb9188 Set the path of pkg-config in a variable instead of hardcoding it
In this way the path of pkg-config can be overridden from the command
line. This is useful for example when cross-compiling.
6 years ago
Hiltjo Posthuma 7e19e11676 Makefile: fix dependencies on config.h
patch by Younes Khoudli (changed slightly). Thanks
6 years ago
Lauri Tirkkonen 096b125db7 output child WEXITSTATUS/WTERMSIG on abnormal termination 6 years ago
Hiltjo Posthuma d7bf023b2f fix memory leak in xloadcols()
reported by Avi Halachmi (:avih)" <avihpit@yahoo.com>

patch slightly changed by me.
6 years ago
Hiltjo Posthuma b4d68d4daa st: small typofix in comment 6 years ago
Hiltjo Posthuma 30ec9a3dc3 small code-style fix 6 years ago
Quentin Rameau 67d0cb65d0 Remove the ISO 14755 feature
And move it to the patches section.
Keeping it would force to add an exec pledge on OpenBSD, and some
people think it's bloated, so bye!
6 years ago
Hiltjo Posthuma 4f4bccd162 Revert "Simplify cursor color handling"
This reverts commit 1911c9274d.
6 years ago
Hiltjo Posthuma 8ed7a4b3b7 Revert "Make cursor follow text color"
This reverts commit b51bcd5553.
6 years ago
Hiltjo Posthuma 732be223ee Revert "Fix crash when cursor color is truecolor"
This reverts commit 5535c1f04c.
6 years ago
Jules Maselbas 5535c1f04c Fix crash when cursor color is truecolor
Reported-by: Ivan Tham <pickfire@riseup.net>
6 years ago
Jules Maselbas b51bcd5553 Make cursor follow text color 6 years ago
Jules Maselbas 1911c9274d Simplify cursor color handling 6 years ago
Jules Maselbas 29f341da7c Fix crash on resize
Prevent to realloc xw.specbuc with a negative number of col.
Add proper hints for the minimal size, for one character.
6 years ago
Hiltjo Posthuma dc3b5babf1 config.mk: remove extra newline before EOF 7 years ago
Hiltjo Posthuma 235a783e03 code-style for pledge(2)
feedback from Klemens, thanks
7 years ago
Hiltjo Posthuma 30ce2cc002 Pledge on OpenBSD 7 years ago
Hiltjo Posthuma 041912a791 error message style and use strerror in a few places 7 years ago
Hiltjo Posthuma bd3f7fd842 st -v: remove years and copyright text 7 years ago
Daniel Tameling 74cff67bd7 set sel.alt in selstart instead of selextend 7 years ago
Hiltjo Posthuma 6f0f2b7ec3 bump version to 0.8.1 7 years ago
Hiltjo Posthuma f4020b2cc4 fix regression by selecting clipboard text
"restore the old behaviour that the primary doesn't get deleted by a simple
left click"

Patch by Daniel Tameling <tamelingdaniel@gmail.com>, thanks!
7 years ago
Hiltjo Posthuma a5a928bfc1 don't modify argv, use a counter
on some platforms (OpenBSD) this changes the exposed argv in tools using
the kvm_* interface, such as ps and pgrep.
7 years ago
Hiltjo Posthuma 6ac8c8aa50 selextend: clarify: !sel.mode == SEL_IDLE 7 years ago
Hiltjo Posthuma 5345db3c9b clipcopy: no need to check for free(NULL), set to NULL after free 7 years ago
Hiltjo Posthuma 7648697f71 minor code-style: whitespace fixes 7 years ago
Quentin Rameau 0b507bb731 Fix title initialization 7 years ago
Quentin Rameau e7ef3c4ce9 Fix regression from 69e32a6 when setting title. 7 years ago
Hiltjo Posthuma 8ab629031b LICENSE: fix a few years 7 years ago
Hiltjo Posthuma a712c2dd18 update LICENSE: major contributors 7 years ago
Hiltjo Posthuma 0f245dfeb9 Makefile: add all files to make dist 7 years ago
Hiltjo Posthuma 49a4f91fc5 bump version to 0.8 7 years ago
Hiltjo Posthuma c5ba9c025b use math.h for ceilf 7 years ago
Hiltjo Posthuma b81888ee7d xhints: no need to initialize sizeh 7 years ago
Hiltjo Posthuma 8b8255ac0e regression: include termios.h for tcsendbreak etc 7 years ago
Devin J. Pohly 20e0da7f14 General cleanup
Simplifies logic in a couple places and removes a redundant function
call.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
7 years ago
Devin J. Pohly 403c57ebb5 Clean up #includes
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
7 years ago
Devin J. Pohly e0215d5377 Reduce visibility wherever possible
When possible, declare functions/variables static and move struct
definitions out of headers.  In order to allow utf8decode to become
internal, use codepoint for DECSCUSR extension directly.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
7 years ago
Devin J. Pohly 30683c70ab Limit usage of extern to config.h globals
Prefer passing arguments to declaring external global variables.  The
only remaining usage of extern is for config.h variables which are
needed in st.c instead of x.c (where it is now included).

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
7 years ago
Devin J. Pohly a3beb626d2 Remove x.c dependency on term
The xinit function only needs to the rows/cols, so pass those in rather
than accessing term directly.  With a bit of arithmetic, we are able to
avoid the need for term.row and term.col in x2col, y2row, and
xdrawglyphfontspecs as well, completing the removal.

Term is now fully internal to st.c.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
7 years ago
Devin J. Pohly a5dc1b4697 Pull term references out of xdrawcursor
Gradually reducing x.c dependency on Term object.  Old and new cursor
glyph/position are passed to xdrawcursor.  (There may be an opportunity
to refactor further if we can unify "clear old cursor" and "draw new
cursor" functionality.)

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
7 years ago