Commit graph

2574 commits

Author SHA1 Message Date
Daniel Eklöf
1109865c8e
render: scrollback indicator: subtract visible rows from populated rows
This prevents the indicator from starting too high up when the number
of used scrollback rows is low.
2020-08-26 19:10:00 +02:00
Daniel Eklöf
cc24c5f2e0
render: scrollback position: only count _used_ scrollback lines
When calculating where in the scrollback history we are, we previously
did this against the total number of scrollback lines. I.e. the
`scrollback.lines` setting in `footrc`.

Now, we count only the used/allocated scrollback lines.

Note that the initial indicator position might still seem to start a
bit high up, if the number of used scrollback lines is low. This is
because we use the *top* of the screen for the current position. Thus,
we'll never be at the bottom (except for the special case when
we're *really* at the bottom).
2020-08-25 18:45:04 +02:00
Daniel Eklöf
a2257cb082
Merge branch 'message-fix' into master 2020-08-23 19:18:27 +02:00
Jonas 'cherti' Große Sundrup
b27e237192
synchronize config-error-message with available field values 2020-08-23 18:50:11 +02:00
Daniel Eklöf
ddef95c297
config: add user-configured search-binding to the correct binding list
Search bindings were added to the normal key binding list...
2020-08-23 09:55:19 +02:00
Daniel Eklöf
ef7429d44a
Merge branch 'colorterm' into master 2020-08-23 06:46:13 +02:00
Craig Barnes
26fccae03d slave: set $COLORTERM environment variable to "truecolor"
This is also done by libvte, alacritty, kitty and several other
terminal emulators as a way to indicate support for 24-bit RGB
colors. It generally also implies support for the xterm 256-color
palette and basic ECMA-48 colors.
2020-08-23 05:33:48 +01:00
Daniel Eklöf
75dc06f303
Merge branch 'timespec-compare-fix' into master 2020-08-23 06:08:38 +02:00
Daniel Eklöf
0788440061
Merge branch 'dont-send-mouse-events-to-client-when-binding-consumed-it' into master 2020-08-23 06:00:42 +02:00
Craig Barnes
0e7723e75f csi: avoid using memcmp() to compare timespec structs
This struct may contain padding bytes, whose values are indeterminate
after any store operation[1]. It may also contain unnamed members,
whose values are always indeterminate[2]. Using memcmp() isn't a
reliable way to compare structs where either of these may be present.

[1]: ISO/IEC 9899:1999 §6.2.6.1, paragraph 6
[2]: ISO/IEC 9899:1999 §6.7.8, paragraph 9

See also:

* https://wiki.sei.cmu.edu/confluence/display/c/EXP42-C.+Do+not+compare+padding+data
* https://sourceware.org/git/?p=glibc.git;a=blob;f=time/bits/types/struct_timespec.h;hb=756c306502498f9
2020-08-23 03:08:35 +01:00
Daniel Eklöf
3ddc17937f
input: inhibit mouse events to client when a binding has consumed it
This introduces a new state to a seat's mouse struct, 'consumed'. It
is set on a mouse *press* event that is claimed by a mouse binding.

It is cleared after a mouse *release* event.

While set, *no* mouse motion or button events are sent to the client
application.
2020-08-22 13:35:36 +02:00
Daniel Eklöf
82e197072b
config: don't pass -1 to mbstowcs(), silences linker(?) warning
'n' _is_ ignored when 'dest' is NULL, but you can still get the
following warning:

    In function ‘mbstowcs’,
        inlined from ‘parse_section_scrollback’ at ../config.c:429:26:
    /usr/include/bits/stdlib.h:129:10: warning: ‘__mbstowcs_alias’ specified size 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
      129 |   return __mbstowcs_alias (__dst, __src, __len);

To silence this warning, pass 0 instead, since it is ignored anyway.
2020-08-22 10:56:53 +02:00
Daniel Eklöf
11cb08f1b5
ci: sr.ht: run a codespell task at the end 2020-08-22 10:25:52 +02:00
Daniel Eklöf
7effd739b4
ci: gitlab: install pip 2020-08-22 10:20:21 +02:00
Daniel Eklöf
9971f3abb1
ci: gitlab: the package is called 'python3', not 'python' 2020-08-22 10:15:46 +02:00
Daniel Eklöf
f506eefe5e
ci: gitlab: pip install codespell
Alpine has no codespell package
2020-08-22 10:14:31 +02:00
Daniel Eklöf
9bedb98a0d
ci: gitlab: run codespell in the 'build' stage
This makes it run in parallel with the compilation steps
2020-08-22 10:14:10 +02:00
Daniel Eklöf
a41244a885
ci: gitlab: run a codespell stage on all *.c and *.h files 2020-08-22 10:11:20 +02:00
Daniel Eklöf
071cda1bd6
Merge branch 'dont-emit-newlines-when-copying-empty-cells' into master
Closes #97
2020-08-21 07:49:12 +02:00
Daniel Eklöf
f85cf47b65
extract: only emit newlines if followed by non-empty cells
Closes #97
2020-08-20 19:22:13 +02:00
Daniel Eklöf
277d676159
Merge branch 'no-async-unwind' into master 2020-08-19 19:09:12 +02:00
Craig Barnes
ce57bfa1ea meson: use "-fno-asynchronous-unwind-tables" for non-debug builds
This removes the DWARF stack unwinding tables, which shrinks the
".eh_frame" and ".eh_frame_hdr" sections by about 24KiB. Stack
unwinding tables are pretty useless to a C program compiled in
release mode.
2020-08-19 17:22:21 +01:00
Daniel Eklöf
c0ddb78f4a
Merge branch 'selection-exclude-trailing-empty-cells' into master 2020-08-19 06:26:29 +02:00
Daniel Eklöf
1a2c6e183f
Merge branch 'update-grid-on-default-fg-bg-change' into master
Closes #94
2020-08-19 06:25:17 +02:00
Daniel Eklöf
9390f6a273
Merge branch 'fallthrough' into master 2020-08-19 06:24:21 +02:00
Craig Barnes
7c58648238 csi: add 2 missing "break" statements in csi_dispatch() 2020-08-18 20:49:44 +01:00
Daniel Eklöf
a48578c857
csi: xtrestore: add 'default' case
Don't call decset_decrst() with an unhandled parameter (and with
'enabled' uninitialized!)
2020-08-18 21:14:05 +02:00
Daniel Eklöf
79d20d75d2
csi: xtrestore: add missing break 2020-08-18 21:13:50 +02:00
Daniel Eklöf
fe95b6a013
changelog: trailing empty cells are not highlighted in mouse selections 2020-08-18 18:03:41 +02:00
Daniel Eklöf
cb9626741a
selection: don't highlight trailing empty cells in a selection
This makes it clear which cells contain spaces (that will be copied)
or are empty (will *not* be copied).
2020-08-18 18:03:07 +02:00
Daniel Eklöf
3e1636c013
osc: dirty grids on *all* color modifying sequences
We only updated the grid for OSC 4 - Set color <idx>. But we did *not*
do it for 104 (reset color <idx>), 10 - set default foreground, 11 -
set default background, 110 - reset default foreground, or 111 - reset
default background.
2020-08-18 17:54:11 +02:00
Daniel Eklöf
e1648bd2b7
Merge branch 'xtsave-xtrestore' into master
Closes #91
2020-08-18 17:51:37 +02:00
Daniel Eklöf
22dcbeacb7
csi: xtsave/xtrestore: implement \E[?12s and \E[?12r
I.e. save/restore cursor-blink state.
2020-08-18 07:00:26 +02:00
Daniel Eklöf
15ae82e62e
csi: decset/decrst: only clear mouse tracking/reporting if mode matches
E.g. only set mouse reporting to NONE, if mouse reporting mode is SGR
and an DECRST SGR is issued.

Do *not* reset the mouse mode if e.g. mouse reporting mode is SGR and
an DECRST URXVT is issued.
2020-08-18 06:53:47 +02:00
Daniel Eklöf
dfcc4192ce
changelog: xtsave/xtrestore 2020-08-16 17:03:58 +02:00
Daniel Eklöf
23a5ff53eb
csi: implement XTRESTORE 2020-08-16 17:02:52 +02:00
Daniel Eklöf
d4473c4e67
term: xtsave: store state in a bitfield
These shouldn't be accessed in any performance critical paths, so lets
save some memory and use a bitfield.
2020-08-16 16:58:32 +02:00
Daniel Eklöf
b4f868e566
csi: xtsave: store modes' SET state, not the current state 2020-08-16 16:57:39 +02:00
Daniel Eklöf
cc48366f02
csi: implement CSI ? Pm s - XTSAVE 2020-08-16 16:47:46 +02:00
Daniel Eklöf
5593868471
csi: add xtsave()
This function stores the current state of DECSET private modes.
2020-08-16 16:46:21 +02:00
Daniel Eklöf
0787080023
csi: decrst: spell decset correctly 2020-08-16 16:38:30 +02:00
Daniel Eklöf
cf315de174
csi: add DEC names to a couple of DECSET modes 2020-08-16 16:25:52 +02:00
Daniel Eklöf
2eebf9b8cc
csi: break out decset/decrst 2020-08-16 16:23:17 +02:00
Daniel Eklöf
38ee05b1c7
Merge branch 'spelling-fix' into master 2020-08-16 16:04:37 +02:00
Craig Barnes
44499bbfe1 Fix spelling mistake in vt.c 2020-08-16 14:37:27 +01:00
Daniel Eklöf
5ab09cdc90
changelog: add ordoviz to contributors 2020-08-16 09:14:15 +02:00
Daniel Eklöf
a767139844
Merge branch 'typos' into master 2020-08-16 09:12:48 +02:00
Lennard Hofmann
df576d9a8e Fix typos 2020-08-15 23:29:38 +02:00
Daniel Eklöf
2ab2f5e99d
Merge branch 'spelling-fixes' into master 2020-08-15 21:28:13 +02:00
Daniel Eklöf
2013c373e6
Merge branch 'typo' into master 2020-08-15 21:26:49 +02:00