Commit graph

1383 commits

Author SHA1 Message Date
Jules Maselbas
5535c1f04c Fix crash when cursor color is truecolor
Reported-by: Ivan Tham <pickfire@riseup.net>
2018-07-15 18:16:52 +02:00
Jules Maselbas
b51bcd5553 Make cursor follow text color 2018-07-14 12:49:37 +02:00
Jules Maselbas
1911c9274d Simplify cursor color handling 2018-07-14 12:49:35 +02:00
Luke Smith
43af5f7790 manual updates 2018-07-08 14:23:08 -04:00
Luke Smith
f9cd5efaa0 shift-insert now pastes from clipboard 2018-07-08 14:22:52 -04:00
Luke Smith
7f231a6b54 xresources patch now default 2018-07-07 03:28:01 -04:00
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.
2018-06-30 20:51:46 +02:00
Luke Smith
195535facc wal compatibility added 2018-06-25 19:28:26 -04:00
Hiltjo Posthuma
dc3b5babf1 config.mk: remove extra newline before EOF 2018-06-02 17:11:14 +02:00
Hiltjo Posthuma
235a783e03 code-style for pledge(2)
feedback from Klemens, thanks
2018-05-25 13:04:09 +02:00
Hiltjo Posthuma
30ce2cc002 Pledge on OpenBSD 2018-05-25 11:59:28 +02:00
Luke Smith
ae9739faed alt-shift-j/k zoom bindings b/c why not lmao 2018-05-01 15:01:58 -07:00
Luke Smith
f6ecf743ab cleaning 2018-05-01 14:42:15 -07:00
Luke Smith
cd357e5c67 Big cleanup and some redundant bindings added 2018-05-01 14:36:36 -07:00
Kornelije Sajler
60ea12d971 Updated few minor changes in README. 2018-04-25 22:58:56 +02:00
Kornelije Sajler
67940f05e5 Updated README with few more info. 2018-04-25 22:53:54 +02:00
Kornelije Sajler
582549f486 Updade README with more info no custom changes.
Updated config.def.h with my/luke preferences. Font=14px, alpha=0xcd, colorname[]=pop_os-inspired.
Changed values for bg,fg and cursor using 256, 257, 258 indexs from colorname[].
Patched with luke's keymapping's.
2018-04-25 22:49:04 +02:00
Kornelije Sajler
0ad3d4eddf Updated st 0.8.1. Used new patches, scrollblock and alpha fixed.
Created run-patches.sh, runs all patches on clean st 0.8.1 code.
All old patches remvoed, including trasparency diff.
Not including solarized theme, don't see value of it.
Commented colornames array with color indexs from 0-15, includes index 255, and afterwards bg, fg and cursor, change those for background, foreground and cursor color. Seems better than solarized toggle.
Updated README.
2018-04-25 22:15:11 +02:00
Hiltjo Posthuma
041912a791 error message style and use strerror in a few places 2018-03-29 18:30:05 +02:00
Hiltjo Posthuma
bd3f7fd842 st -v: remove years and copyright text 2018-03-29 18:18:30 +02:00
Daniel Tameling
74cff67bd7 set sel.alt in selstart instead of selextend 2018-03-29 18:15:29 +02:00
Hiltjo Posthuma
6f0f2b7ec3 bump version to 0.8.1 2018-03-20 21:29:10 +01:00
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!
2018-03-20 21:25:30 +01:00
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.
2018-03-20 21:22:27 +01:00
Hiltjo Posthuma
6ac8c8aa50 selextend: clarify: !sel.mode == SEL_IDLE 2018-03-17 13:48:29 +01:00
Hiltjo Posthuma
5345db3c9b clipcopy: no need to check for free(NULL), set to NULL after free 2018-03-17 13:48:10 +01:00
Hiltjo Posthuma
7648697f71 minor code-style: whitespace fixes 2018-03-16 16:45:58 +01:00
Quentin Rameau
0b507bb731 Fix title initialization 2018-03-16 16:44:30 +01:00
Quentin Rameau
e7ef3c4ce9 Fix regression from 69e32a6 when setting title. 2018-03-16 16:44:30 +01:00
Hiltjo Posthuma
8ab629031b LICENSE: fix a few years 2018-03-14 20:08:00 +01:00
Hiltjo Posthuma
a712c2dd18 update LICENSE: major contributors 2018-03-14 20:00:35 +01:00
Hiltjo Posthuma
0f245dfeb9 Makefile: add all files to make dist 2018-03-14 19:54:50 +01:00
Hiltjo Posthuma
49a4f91fc5 bump version to 0.8 2018-03-14 19:50:37 +01:00
Luke Smith
efad574780 transparency more opaque 2018-03-12 10:57:47 -07:00
Luke Smith
8c0ade2c1e transparency now default 2018-03-10 19:52:41 -07:00
Hiltjo Posthuma
c5ba9c025b use math.h for ceilf 2018-03-09 15:36:38 +01:00
Hiltjo Posthuma
b81888ee7d xhints: no need to initialize sizeh 2018-03-09 15:36:25 +01:00
Hiltjo Posthuma
8b8255ac0e regression: include termios.h for tcsendbreak etc 2018-03-09 15:35:34 +01:00
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>
2018-02-25 21:56:26 -06:00
Devin J. Pohly
403c57ebb5 Clean up #includes
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-25 21:56:26 -06:00
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>
2018-02-25 21:56:26 -06:00
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>
2018-02-25 21:56:26 -06:00
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>
2018-02-25 21:56:26 -06:00
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>
2018-02-25 21:56:26 -06:00
Devin J. Pohly
88d8293fb4 Move win-agnostic parts of draw/drawregion to st.c
Introduces three functions to encapsulate X-specific behavior:
 * xdrawline: draws a portion of a single line (used by drawregion)
 * xbegindraw: called to prepare for drawing (will be useful for e.g.
   Wayland) and returns true if drawing should happen
 * xfinishdraw: called to finish drawing (used by draw)

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-25 21:56:26 -06:00
Devin J. Pohly
05c66cb37d Split mode bits between Term and TermWindow
Moves the mode bits used by x.c from Term to TermWindow, absorbing
UI/input-related mode bits (visible/focused/numlock) along the way.

This is gradually reducing external references to Term.  Since
TermWindow is already internal to x.c, we add xsetmode() to allow st to
modify window bits in accordance with escape sequences.

IS_SET() is redefined accordingly (term.mode in st.c, win.mode in x.c).

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-25 21:56:26 -06:00
Devin J. Pohly
33201ac65f Move CRLF input processing into ttywrite
This also allows us to remove the crlf field from the Key struct, since
the only difference it made was converting "\r" to "\r\n" (which is now
done automatically in ttywrite).  In addition, MODE_CRLF is no longer
referenced from x.c.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-25 21:53:24 -06:00
Devin J. Pohly
52d6fb1ab1 Move terminal echo logic into st.c
The only thing differentiating ttywrite and ttysend was the potential
for echo; make this a parameter and remove ttysend.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-25 21:53:24 -06:00
Devin J. Pohly
cfc7acdfd9 Move remaining selection mode logic into selextend
The "done" parameter indicates a change which finalizes the selection
(e.g. a mouse button release as opposed to motion).

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-25 21:53:24 -06:00
Devin J. Pohly
bcb5d3adbe Move terminal-related selection logic into st.c
The front-end determines information about mouse clicks and motion, and
the terminal handles the actual selection start/extend/dirty logic by
row and column.

While we're in the neighborhood, we'll also rename getbuttoninfo() to
mousesel() which is, at least, less wrong.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-25 21:53:24 -06:00