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
Wez Furlong
4dcab21a97
placeholder for alt graphics mode
...
These are emitted by `top`
2018-01-31 10:15:39 -08:00
Wez Furlong
45793bd594
Add some more tests and bounds checks/limits
2018-01-31 10:07:50 -08:00
Wez Furlong
a55395d7c9
start building out unit tests
2018-01-30 22:44:14 -08:00
Wez Furlong
0eb4dd44b3
add IL and DL sequences
...
These probably aren't quite right
2018-01-30 07:31:31 -08:00
Wez Furlong
cb9a2129be
handle reverse index escape sequence
...
This unlocks pressing `b` in `less` and `more` to scroll backwards.
To facilitate this I had to do a better job at scrolling up and down,
so beef up the code to enable that. Scroll regions still need some
work; test case for that is running vim and then opening help.
Also: fixup the y position when rending rows; it was off by one row.
2018-01-29 23:29:56 -08:00
Wez Furlong
0ebf84ee1c
adopt dirtying mechanism for more efficient screen updates
...
We now keep track of the dirty status on a per-line basis
and use that status to realize when we need to repaint a portion
of the screen. This reduces the compute cost of redrawing
quite significantly; we're no longer on `top` when we're running
`top`!
2018-01-29 20:38:48 -08:00
Wez Furlong
740c3339a5
Add glyph caching
2018-01-29 09:38:06 -08:00
Wez Furlong
5b1ccc59b6
make CSIParser a bit more compact
...
The simpler escape sequences were getting a bit boiler-platey and long,
so hoist them up and perform matching at the main level. This has the
side effect of discarding params after a match; that's fine for these
as it only seems to be important for the SGR sequences.
2018-01-29 08:00:30 -08:00
Wez Furlong
be30b1cb54
there's already a wterm, rename to wezterm
2018-01-28 23:52:21 -08:00
Wez Furlong
544dd70ac1
Add CUU, CUD, CUB handling
2018-01-28 23:50:53 -08:00
Wez Furlong
67f07b4fcc
add primitive auto wrapping support
2018-01-28 23:44:38 -08:00
Wez Furlong
5dbf90412f
bounds check should be on the actual number of cols
...
Don't trust that a given Line has exactly phys_cols columns.
2018-01-28 23:33:31 -08:00
Wez Furlong
4a4d8c7186
add CUF cursor move support
2018-01-28 22:25:53 -08:00
Wez Furlong
2e73b937bb
Add some state to track vertical scroll regions
...
However, it doesn't really do very much that is useful yet
2018-01-28 21:16:59 -08:00
Wez Furlong
6ed0e81f02
fix SetCursorPosXY; had rows/cols flipped
2018-01-28 21:13:11 -08:00
Wez Furlong
13a856bbb2
add device attributes answerback
2018-01-28 20:46:34 -08:00
Wez Furlong
1059620233
add stub for setting the scroll region
2018-01-28 20:33:21 -08:00
Wez Furlong
2011eec9f2
clamp cursor y position when moving the cursor
2018-01-28 19:30:07 -08:00
Wez Furlong
001eda902b
tidy up basic scroll handling
...
Previously, we would not allocate a new line and would end up
panicking when we went off the end of the default screen height.
2018-01-28 18:05:22 -08:00
Wez Furlong
8d9cd83e6d
add some more comments on CSIParser
2018-01-28 17:11:05 -08:00
Wez Furlong
0057b42c4f
Pull intermediates check up higher in CSIParser
...
This should reduce the chance of ambiguous matches for sequences
that have the same 'byte' field but different intermediates.
2018-01-28 17:01:15 -08:00
Wez Furlong
78c3aee697
Add support for responding to escape sequences
2018-01-28 16:43:10 -08:00
Wez Furlong
d28494ac20
recognize device status report codes
2018-01-28 15:11:07 -08:00
Wez Furlong
b696aae51f
vim truecolor mode uses kde style rgb sgr
2018-01-28 14:55:28 -08:00
Wez Furlong
a0cc6822ef
add support for recognizing some decset modes
...
We don't do anything about those modes yet.
2018-01-28 14:51:00 -08:00
Wez Furlong
5816928a25
Add support for Erase In Display
2018-01-28 14:12:56 -08:00
Wez Furlong
39a5b5ef0d
add some comments about CSIParser
2018-01-28 14:03:57 -08:00
Wez Furlong
d48bc62a18
move all the current CSI parsing into the CSIParser
2018-01-28 13:53:18 -08:00
Wez Furlong
12a839c4ac
Adopt slice patterns for parsing CSI
2018-01-28 13:36:17 -08:00
Wez Furlong
2eefee4412
move csi parsing to its own file
2018-01-28 11:35:36 -08:00
Wez Furlong
cedc62e91a
fix cursor positioning when ligatures are used
2018-01-28 09:55:28 -08:00
Wez Furlong
dbeda14566
Add ShmImage, a shared memory Pixmap
...
Using the SHM extension of the X server saves us from sending ~1MB of
bitmap data to the server on many screen update operations for a
modestly sized terminal window.
SHM may not be available in some situations so we need to keep a
fallback that basically works. This is done via a helper enum
in xwin.rs.
I've removed the unused Pixmap class; the pixmap concept makes the
most sense for us only when SHM is available.
2018-01-28 09:43:36 -08:00
Wez Furlong
91424e427f
factor out BitmapImage from Image
2018-01-27 22:58:40 -08:00
Wez Furlong
bf854d0eb0
remove some unused code
2018-01-27 22:24:44 -08:00
Wez Furlong
0ab8cf1eec
Render the cursor position, fixup colors
...
I thought it would be nice to use the default xterm palette, but
I really hate the contrast of its default blue on black, so switch
to the palette from my xterm config.
2018-01-27 22:17:31 -08:00
Wez Furlong
1d4fc17187
apply Deref to simplify Terminal/TerminalState
2018-01-27 21:56:29 -08:00
Wez Furlong
1ae85b2349
send keyboard input to the pty
2018-01-27 21:54:57 -08:00
Wez Furlong
f879447d59
add xgfx::Connection, store atoms inside it
2018-01-27 14:49:15 -08:00
Wez Furlong
ec3c8f04ba
move TerminalWindow into its own file
2018-01-27 14:29:07 -08:00
Wez Furlong
ee85a0bdcd
avoid .bk files when rustfmt'ing
2018-01-27 14:20:15 -08:00
Wez Furlong
5d6d9747c7
expand columns as needed for set_cell
2018-01-27 13:56:35 -08:00
Wez Furlong
2d739eb667
Ensure that the pty is the controlling terminal for the child
2018-01-27 13:51:10 -08:00
Wez Furlong
8080718c71
Listen for sigchld
2018-01-27 13:41:45 -08:00
Wez Furlong
a11a34b031
We're now able to run and render top
2018-01-27 13:38:26 -08:00