Wez Furlong
a7f2757452
rustfmt update
2018-02-20 22:08:19 -08:00
Wez Furlong
7c0536f9a3
avoid panic if an app sets an invalid scroll region
2018-02-20 08:42:08 -08:00
Wez Furlong
279b2018fd
Render cursor and selection for resized lines
...
If the user enlarges the terminal we can have regions of the vertex
buffer that have colors that default to alpha channel 0. This is
normally fine but breaks rendering of the cursor and the selection;
those attributes are out of band from the normal cell attributes,
especially for whitespace cells, so we need to handle those in
the degenerate case at the end of a line render.
Refactor the code that computes the cursor and selection colors
so that we can call it and use it in both places.
2018-02-19 21:29:27 -08:00
Wez Furlong
25e2dc2a96
fix an issue with the selection when in scrollback
2018-02-19 16:26:10 -08:00
Wez Furlong
dd238d5b50
add DCH
2018-02-19 15:33:13 -08:00
Wez Furlong
d041b7be0d
fix an issue with scrolling within a region
2018-02-19 14:39:07 -08:00
Wez Furlong
37e5d8571a
add HVP sequence. Just like CUP.
2018-02-19 14:02:54 -08:00
Wez Furlong
c9eba103d1
Use vecdeque for screen lines
...
This brings us back in the right perf ballpark
2018-02-19 13:08:47 -08:00
Wez Furlong
58f423eebe
fix bounds for scrolling
...
unfortunately this is super expensive and halves the cat test perf.
2018-02-19 11:26:19 -08:00
Wez Furlong
02846f4c82
use Cell::reset to clear portions of a line
2018-02-19 10:51:34 -08:00
Wez Furlong
a0b4630998
micro opt cursor moving during print
2018-02-19 10:47:49 -08:00
Wez Furlong
aa95eaefd9
micro-opt scroll_up some more
2018-02-19 10:27:28 -08:00
Wez Furlong
48997f02d1
micro optimize cell creation
2018-02-19 09:08:17 -08:00
Wez Furlong
1b989b011d
improve scroll_up perf
...
We were marking the entire scrollback history as dirty on each line
scroll. This was from the early days and isn't needed any more.
This brings the runtime of:
```
$ find /usr > /tmp/usr-files.txt
$ time cat /tmp/usr-files.txt
```
down from ~2.5s to ~1.2s.
Also avoid a redundant line_mut() call in set_cell().
2018-02-19 08:14:03 -08:00
Wez Furlong
563408df6f
micro optimization for scroll_up
2018-02-19 07:55:49 -08:00
Wez Furlong
450ed0e82c
don't explode when scrolling back
2018-02-18 23:04:11 -08:00
Wez Furlong
fa0549b76e
add some more comments
...
and back out the get_all flag that was added as a temp workaround
in the earlier stages of adding opengl support.
2018-02-18 17:21:02 -08:00
Wez Furlong
de700e0207
make it very slightly cheaper to enumerate the screen lines
2018-02-17 15:04:48 -08:00
Wez Furlong
b8eb6dbedc
make color -> uniform conversion more ergonomic
2018-02-17 08:25:59 -08:00
Wez Furlong
c8a58cac06
we now render useless blocks in the fg color via gl
2018-02-16 23:28:51 -08:00
Wez Furlong
20965e786f
start hacking on OpenGL ES2 rendering
2018-02-16 21:44:56 -08:00
Wez Furlong
20f4b21f13
add some more tests
2018-02-12 08:25:31 -08:00
Wez Furlong
28179ff981
check negative value for ECH, too
2018-02-12 08:15:35 -08:00
Wez Furlong
438822d63b
add ECH handling
2018-02-12 07:57:22 -08:00
Wez Furlong
09f481e753
avoid ambiguous true color csi SGR sequence
2018-02-12 07:40:35 -08:00
Wez Furlong
ad3524bfc8
run down an off-by-one in VPA handling
...
This manifested with vim-inside-tmux losing my top tmux status line.
Add a test!
2018-02-11 23:56:42 -08:00
Wez Furlong
0870e6c7e4
tweak comments and error printing around OSC
2018-02-11 22:29:21 -08:00
Wez Furlong
6fb12c3520
add test for reverse index
2018-02-11 21:58:53 -08:00
Wez Furlong
18990a24b4
Basic tab stops
2018-02-11 21:54:18 -08:00
Wez Furlong
4c087d32c1
add NEL sequence and test
2018-02-11 20:56:05 -08:00
Wez Furlong
e6fdd4140b
add more tests
2018-02-11 20:46:59 -08:00
Wez Furlong
5e49a79705
fix a selection range issue
...
When dragging a multi-line selection down and to the left, we were
incorrectly setting the computed column range.
Add a test and fix it.
2018-02-11 18:35:58 -08:00
Wez Furlong
2ee0414b66
avoid panic when dragging onto partial rows/columns
2018-02-11 18:09:48 -08:00
Wez Furlong
d0de936f62
add some tests for a double-width selection bug
2018-02-11 17:56:49 -08:00
Wez Furlong
adc11f303a
Add some tests for hyperlink parsing and handling
2018-02-11 13:48:51 -08:00
Wez Furlong
ac339f9258
refactor term tests to make it less repeaty
2018-02-11 13:01:36 -08:00
Wez Furlong
21f0e3fd98
Recognize clicks on hyperlinks
...
There's plumbing for handling these events in the TerminalHost
trait, but we don't do anything beyond printing them at the moment.
2018-02-11 12:28:37 -08:00
Wez Furlong
b6aa2cffea
make hyperlinks show underlined on hover
...
Adds some plumbing to track the current mouse position and
extract the hyperlink from the cell that is being hovered over.
We render those cells with underline, possibly in a different color.
We don't yet do anything on click.
2018-02-11 12:11:02 -08:00
Wez Furlong
1546c2ef0b
avoid constructing a vec in the common answerback code path
2018-02-11 09:44:04 -08:00
Wez Furlong
7ad2468937
hide AnswerBack from the public interface
...
This felt a bit repeatey and it pre-dated the TerminalHost trait.
I'd like to remove it completely but there are some frustrating and
fiddly lifetime concerns with mutable TerminalHost reference so I'm
hiding it from the public interface and bridging it the answerback
stream into the host at the bottom of the advance_bytes method for
now.
2018-02-11 09:40:02 -08:00
Wez Furlong
5a6ed045ad
Render underline and double underline
2018-02-10 21:25:43 -08:00
Wez Furlong
ff34198b8a
move terminalstate to its own file
2018-02-10 19:14:16 -08:00
Wez Furlong
2329783082
move Terminal to its own file
2018-02-10 19:10:04 -08:00
Wez Furlong
b967bfe3fd
move screen to own file
2018-02-10 19:01:44 -08:00
Wez Furlong
604d1c27d7
move line to its own file
2018-02-10 18:55:43 -08:00
Wez Furlong
ddef4e7f7c
move cell types to their own file
2018-02-10 18:49:57 -08:00
Wez Furlong
7e7c622b79
move input types to their own file
2018-02-10 18:41:58 -08:00
Wez Furlong
55ae1fb76a
move selection types to their own file
2018-02-10 18:41:40 -08:00
Wez Furlong
68949808ba
parse and record hyperlinks as cell attributes
2018-02-10 15:45:45 -08:00
Wez Furlong
1500063c96
Start adding hyperlink support code
2018-02-10 15:12:21 -08:00
Wez Furlong
76fe17b20b
Cell is no longer Copy
...
This will support Cells owning `Rc<>` to things like hyperlink
data or image data.
2018-02-10 09:52:14 -08:00
Wez Furlong
629a12a3a0
address a minor todo re: alt screen
2018-02-10 09:50:33 -08:00
Wez Furlong
6b182ffe52
implement an equivalent to xterm*boldColor
...
I love my tomato bold!
2018-02-10 08:36:34 -08:00
Wez Furlong
3075e47c89
Allow configuring colors
2018-02-10 08:16:20 -08:00
Wez Furlong
7ab462f2bd
fixup alt-KEY to send escape rather than set bits
2018-02-09 16:03:09 -08:00
Wez Furlong
d289906dbc
Add double click to select a word
2018-02-09 15:47:41 -08:00
Wez Furlong
a28b5f5390
add triple-click to select a line
2018-02-09 08:19:10 -08:00
Wez Furlong
1619f786a9
Add somewhat primitive text selection for copy/paste
2018-02-08 21:35:26 -08:00
Wez Furlong
edd5911535
Add a small font styling engine
...
This enables selecting an italic font when the cell is italic,
but has more power beyond just that simple property.
This runs a little hot on the CPU so there's probably some caching and
tweaking that can be done to make the evaluation a bit cheaper.
2018-02-07 09:23:24 -08:00
Wez Furlong
532cf28782
add support for setting the primary selection
2018-02-06 20:40:46 -08:00
Wez Furlong
a4c7de7b9b
We now support shift+insert to paste the selection
2018-02-05 08:22:08 -08:00
Wez Furlong
b24ac14c05
Add TerminalHost trait
...
This will make it easier to add copy/paste handling in a follow up.
2018-02-04 22:35:33 -08:00
Wez Furlong
5261f9f3d8
Enable mouse reporting
...
There's a bit of restructuring of XCB event handling going on to enable
this, and we only support SGR reporting at the moment.
2018-02-04 20:53:03 -08:00
Wez Furlong
f89d37401b
Enable viewing the scrollback
...
Both mouse wheel and shift+{PageUp,PageDown} can be used to adjust
the scroll viewport.
2018-02-04 14:19:12 -08:00
Wez Furlong
09c70930b9
improve resize handling
...
Both in terms of resizing the window and running the `resize` utility.
2018-02-04 09:17:05 -08:00
Wez Furlong
4c8e3ffd75
improve clustering and cursor rendering
...
We weren't quite right with handling the cursor around double-width
characters. We're now a bit more robust at this because we're
clustering and taking pains to consider the printable width of the
cell as well as the width of the shaped (eg: with contextual ligatures)
glyph.
There may still be issues with contextual ligatures of length 3,
but I haven't managed to nail down exactly the issue yet.
2018-02-04 08:28:32 -08:00
Wez Furlong
78c2df34fc
use Range for scroll region
2018-02-02 09:02:30 -08:00
Wez Furlong
904f8fc059
better typing for rows and cursor position
2018-02-02 08:16:07 -08:00
Wez Furlong
c63c39409a
use Position for line positioning CSIAction's
2018-02-02 07:35:08 -08:00
Wez Furlong
d152055700
reduce the variations on set/delta for cursor positioning
2018-02-02 00:46:04 -08:00
Wez Furlong
bb186da400
avoid eagerly casting some parsed sequences to usize
...
This helps to avoid unexpected integer overflow
2018-02-02 00:23:30 -08:00
Wez Furlong
25773466fb
add a couple of sequences used by tmux when man is running
2018-02-01 07:42:16 -08:00
Wez Furlong
1cc180b813
test and fix a scrolling related bug
2018-02-01 00:22:33 -08:00
Wez Furlong
622c573201
fix boundary issue when scrolling and scrollback exceeded
2018-01-31 21:26:05 -08:00
Wez Furlong
e7e0aeebc2
Add support for cursor keys
2018-01-31 20:31:06 -08:00
Wez Furlong
a49e4b653b
fix an issue with CR processing
...
This eliminates the zsh reversed % artifact issue.
Added a feature flag to turn on diagnostics even in release mode;
`cargo run --release --features debug-escape-sequences`
2018-01-31 19:00:15 -08:00
Wez Furlong
659ce4fc2d
Make answerback more generic, enable title changing
2018-01-31 15:15:23 -08:00
Wez Furlong
11e6d538fc
move term to its own crate
...
This makes it harder to accidentally violate separation of concerns.
2018-01-31 10:50:21 -08:00