Commit graph

584 commits

Author SHA1 Message Date
Daniel Eklöf
b8b43e2eab
search: fix start/end row in selection 2019-08-28 17:28:26 +02:00
Daniel Eklöf
64179bce46
search: start search in current view, rather than from end-of-output 2019-08-28 17:28:26 +02:00
Daniel Eklöf
777863ac3e
term: add term_reset_view() - make view follow end-of-output again 2019-08-28 17:27:42 +02:00
Daniel Eklöf
6fa1734468
README: document keyboard shortcuts related to scrollback searching 2019-08-27 21:20:24 +02:00
Daniel Eklöf
064063fa49
search: match case insensitive 2019-08-27 21:16:57 +02:00
Daniel Eklöf
bd5e579867
search: sort includes 2019-08-27 21:11:40 +02:00
Daniel Eklöf
36350b01a5
search: disable log output 2019-08-27 21:11:29 +02:00
Daniel Eklöf
2759152285
search: loop through the *entire* scrollback buffer 2019-08-27 21:09:37 +02:00
Daniel Eklöf
58d0657a97
selection: allow selections while searching scrollback 2019-08-27 20:57:58 +02:00
Daniel Eklöf
2895f8fa10
search: cancel selection and clear match stats when we don't match 2019-08-27 19:58:44 +02:00
Daniel Eklöf
c3b5fa82be
search: 'len' is unused in release builds (it's only used in an assert) 2019-08-27 19:58:31 +02:00
Daniel Eklöf
c1bbb64a4d
search: return early after committing a search
This fixes an issue where the selection was finalized, but then
cleared.
2019-08-27 19:56:16 +02:00
Daniel Eklöf
d1974913f7
search: search_update() is always called at end of search_input() 2019-08-27 19:56:02 +02:00
Daniel Eklöf
d518d9dafb
search: don't create a new selection when match start coords haven't changed 2019-08-27 19:55:41 +02:00
Daniel Eklöf
3f767be500
input: cancel search on mouse button events 2019-08-27 19:48:29 +02:00
Daniel Eklöf
43fc297fbd
main: free search buffer 2019-08-27 19:43:50 +02:00
Daniel Eklöf
bb4fd58223
render: don't dim selection while searching 2019-08-27 19:40:07 +02:00
Daniel Eklöf
aee5045395
search: wip: initial search matching
* match search buffer against scrollback content
* adjust view to ensure matched content is visible
* create selection on a successful match
* finalize selection when user presses enter (to "commit" the search)
* ctrl+r searches for the next match. Needs more work though.
2019-08-27 19:33:19 +02:00
Daniel Eklöf
61cabdac13
search: wip: re-direct input while searching, and build a search buffer
This adds a new state, 'is_searching'. While active, input is
re-directed, and stored in a search buffer. In the future, we'll use
this buffer and search for its content in the scrollback buffer, and
move the view and create a selection on matches.

When rendering in 'is_searching', everything is dimmed. In the future,
we'll render the current search buffer on-top of the dimmed "regular"
terminal output.
2019-08-27 17:23:28 +02:00
Daniel Eklöf
2d7ca416f0
render: center grid in window
Instead of placing the upper left corner of the grid at 0,0 in the
window, center it.
2019-08-27 15:25:35 +02:00
Daniel Eklöf
382bea8309
vt: tidy lazy initialization of escape parameters 2019-08-27 15:24:49 +02:00
Daniel Eklöf
936526ed5b
vt: no need to reset OSC string in CLEAR action
... as this is done when a new OSC string is started
2019-08-27 15:24:19 +02:00
Daniel Eklöf
8d65f45bf5
vt: store alt charset characters as wchars 2019-08-27 15:23:50 +02:00
Daniel Eklöf
0c5a19f950
vt: bug: fix lazy initialization of sub parameter value (off-by-one) 2019-08-24 11:39:28 +02:00
Daniel Eklöf
9b74cedb20
vt: clear CSI parameters lazily
The CLEAR action is so common, that explicitly clearing the entire
params array, which is kind of big, is too slow.

Clear it lazily instead. Meaning, we only set 'idx' (count) to 0 in
CLEAR. Then whenever we parse a parameter, clear the value and sub
parameters.
2019-08-24 11:33:13 +02:00
Daniel Eklöf
dcf6d18872
render: log frame rendering time with microseconds instead of milliseconds 2019-08-24 11:32:28 +02:00
Daniel Eklöf
6f0e92627e
generate-alt-random-writes: reset SGR and scroll region at the end 2019-08-23 21:06:33 +02:00
Daniel Eklöf
5ce60703a5
config: turn info log message into a debug log message 2019-08-23 20:21:27 +02:00
Daniel Eklöf
0c90717249
grid: remove commented out code 2019-08-23 20:07:27 +02:00
Daniel Eklöf
0a40a5b6a2
term: remove commented out code 2019-08-23 20:07:05 +02:00
Daniel Eklöf
990eacdad4
colors: change default 'bright0' from 000000 -> 666666 2019-08-23 19:42:14 +02:00
Daniel Eklöf
7026f60717
add config + command line option for setting initial window width/height 2019-08-23 17:26:41 +02:00
Daniel Eklöf
4e2067446a
main: use slave's exit value as our exit value 2019-08-23 17:23:47 +02:00
Daniel Eklöf
74a0c5f3fc
render: change resize debug log message to an info log message 2019-08-23 17:23:09 +02:00
Daniel Eklöf
7c7720a3ab
scrolling: optimize row access by assuming number of rows is a power of 2
With this assumption, we can replace 'a % b' with 'a & (b - 1)'. In
terms of instructions, this means a fast 'and' instead of a slow
'div'.

Further optimize scrolling by:

* not double-initializing empty rows. Previously, grid_row_alloc()
  called calloc(), which was then followed by a memset() when
  scrolling. This is of course unnecessary.

* Don't loop the entire set of visible rows (this was done to ensure
  all visible rows had been allocated, and to prefetch the cell
  contents).

  This isn't necessary; only newly pulled in rows can be NULL. For
  now, don't prefetch at all.
2019-08-22 17:33:23 +02:00
Daniel Eklöf
f0663c951e
generate-alt-random-writes: generate color, scroll and scroll region sequences 2019-08-22 17:31:13 +02:00
Daniel Eklöf
0cb3e70ecf
PKGBUILD: profiling payload: random writes to the alt screen 2019-08-21 20:01:59 +02:00
Daniel Eklöf
832f6520d0
generate-alt-random-writes: script to generate payload for profiling 2019-08-21 20:01:17 +02:00
Daniel Eklöf
2b96f32d19
PKGBUILD: prepare for profile guided compilation 2019-08-21 19:41:41 +02:00
Daniel Eklöf
c75518123b
PKGBUILD: performance: build without stack protector 2019-08-21 19:38:48 +02:00
Daniel Eklöf
675504308a
osc: add debug logs when colors are changed and reset 2019-08-21 18:54:12 +02:00
Daniel Eklöf
d8fb80ea32
term: rename colors256 -> table 2019-08-21 18:50:24 +02:00
Daniel Eklöf
631e0c0870
term: use colors256 array for *all* colors
That is, remove the 'regular' and 'bright' color arrays. This is
possible since the 256-color array is defined such that the first 16
colors map to the regular and bright colors.
2019-08-21 18:47:48 +02:00
Daniel Eklöf
65e4b93a03
osc: fix indexing into 'bright' color array 2019-08-21 18:02:18 +02:00
Daniel Eklöf
52ece3592c
osc: implement "change color" commands
This implements OSC 4, 10, 11 - change <color>/foreground/background,
and their corresponding 'query' variant (which was already implemented
for OSC 10/11).

It also implements OSC 104, 110, 111 - reset
<color>/foreground/background.

Set corresponding terminfo entries to signal this support to clients.
2019-08-21 17:57:02 +02:00
Daniel Eklöf
c1903f5522
render: multiply width/height with *new* scale factor, not old 2019-08-21 17:56:41 +02:00
Daniel Eklöf
d7aaeaedee
csi: move 256-color table into the terminal struct 2019-08-21 17:56:21 +02:00
Daniel Eklöf
3efc30c6a1
main: fix debug logs 2019-08-21 17:55:40 +02:00
Daniel Eklöf
842d114cdb
main: don't set scale before we know what it actually should be 2019-08-21 17:55:11 +02:00
Daniel Eklöf
0a80269be7
main: we *do* track outputs 2019-08-21 17:54:58 +02:00