128 Commits

Author SHA1 Message Date
Mitchell Hashimoto
a9b34b43c5 code for getting physical DPI
we don't need it but I want to put it in Git history
2022-08-25 15:53:29 -07:00
Mitchell Hashimoto
9601920b4d font size is now in font points, determine size based on window DPI 2022-08-25 12:29:28 -07:00
Mitchell Hashimoto
3b5a9caff5 hook up more control keys: home, end, page up, page down 2022-08-24 11:16:36 -07:00
Mitchell Hashimoto
80376ce6da hook up keybindings for copy/paste and arrow keys 2022-08-24 11:08:39 -07:00
Mitchell Hashimoto
e6f09093dd unify non-printables up by bindings 2022-08-24 10:21:27 -07:00
Mitchell Hashimoto
b33268cee3 only handle non-printables on press/release, and BS is 0x7F 2022-08-24 10:18:05 -07:00
Mitchell Hashimoto
622537d665 look up keybindings on keypress, clean up how non-printables are handled 2022-08-24 10:02:13 -07:00
Mitchell Hashimoto
7303909d01 key.Binding and basic parsing 2022-08-23 17:40:36 -07:00
Mitchell Hashimoto
eeaad799e5 get rid of Z buffer stuff
This optimization will take more work, and we already got a lot of the
way there by optimizing how we send data down to the GPU.
2022-08-19 13:48:34 -07:00
Mitchell Hashimoto
73e43b6e64 Grid supports sending partial cell updates to GPU 2022-08-19 12:54:07 -07:00
Mitchell Hashimoto
390d95a5af Enable depth buffer, add depth to shader 2022-08-19 10:07:30 -07:00
Mitchell Hashimoto
b562eec83c erase display complete should scroll to bottom 2022-08-17 17:24:09 -07:00
Mitchell Hashimoto
16f981a48a Typing a character clears selection, scrolls to bottom 2022-08-17 17:23:58 -07:00
Mitchell Hashimoto
2f36d5f715 pkg/tracy 2022-08-17 14:03:49 -07:00
Mitchell Hashimoto
b2192ea8f7 move libuv into pkg 2022-08-16 17:47:44 -07:00
Mitchell Hashimoto
3b7a6b78a7 fix ttyWrite calculation to avoid truncating data
the math was wrong. The easiest way to see this was attempting to paste
a large chunk of text, it'd just skip certain parts and truncate it.
2022-08-15 09:57:38 -07:00
Mitchell Hashimoto
e3ddffdf36 don't scale up OpenGL projection in Retina, use true values
This gets rid of blurriness.
2022-08-09 10:21:23 -07:00
Mitchell Hashimoto
f94f3cb5a4 enable retina on Mac, set OpenGL to pixel size properly
This makes things look a bit better, but trades pixelation for blurry
(still TODO). This also fixes an issue on Retina where if you resize
it'd make the viewport 1/4 of the size. The issue here is that OpenGL
uses pixels and glfw uses screen coordinates for everything. We adapt
the screen coords to pixels properly here.
2022-08-09 10:06:30 -07:00
Mitchell Hashimoto
57cec33303 set a minimum window size
Fixes #4

The currently picked 10x4 is somewhat arbitrary but matches
Terminal.app. We can make this configurable.
2022-08-09 08:59:45 -07:00
Mitchell Hashimoto
1da5ca0a7f mouse xpos/ypos can be negative or larger than window size
When calculating the viewport point, we need to consider this. We clamp
the possible values to [0, width/height - 1]. Fixes #1.
2022-08-06 16:05:32 -07:00
Mitchell Hashimoto
ce6f022a7e cursor should be a hollow rect on unfocus, regression from e163e4962baad09cd2c36be1529dee4fcf1220b0 2022-08-05 19:26:50 -07:00
Mitchell Hashimoto
d4c4330d4d copy! 2022-08-05 11:37:02 -07:00
Mitchell Hashimoto
0855d391a8 fix selection of a single character
This logic is truly terrible and I know for certain there is an easier
way to calculate this. I also know there are some bugs here. But, the
user-facing result is not bad so let's start with this.
2022-08-04 16:53:10 -07:00
Mitchell Hashimoto
40161a9eff track mouse state, setup selection state on cursor move with click 2022-08-04 14:21:40 -07:00
Mitchell Hashimoto
bb0b95732e opengl: support extension iteration, list in debug mode 2022-08-04 11:13:56 -07:00
Mitchell Hashimoto
e163e4962b refactor cursor implementation, implement cursor visible (mode 25)
This cleans up a ton of state management around cursor styles,
visibility, blinking, etc. This was long in the tooth and when I was
trying to implement mode 25 I realized it was impossible with the
spaghetti mess I had. This made it really clean.

With this refactor, the Window keeps the "terminal_cursor" field the
proper state, and the render callback properly updates the gpu cells for
the cursor settings.

This also implements mode 25 (cursor visible) which makes neovim not
"flash" when vertically scrolling a vertical split. Neovim does some
cursor stuff but while doing so hides the cursor. This now respects
that.
2022-08-03 21:39:42 -07:00
Mitchell Hashimoto
1680aee880 some logging improvements 2022-08-03 21:13:05 -07:00
Mitchell Hashimoto
befeb08b3d add a lot more tracing as I hunt down some performance things 2022-08-03 09:56:32 -07:00
Mitchell Hashimoto
0bc8300e74 remove unused line 2022-08-02 21:45:20 -07:00
Mitchell Hashimoto
40cec18943 implement DECSASD by just blackholing the output for now
We don't want to support status lines, and if anything sends us status
line information we don't want it to mess up the main display, so just
drop it.
2022-08-02 11:03:01 -07:00
Mitchell Hashimoto
2b80699179 cursor position absolute needs to ignore all the offset stuff 2022-08-02 10:30:20 -07:00
Mitchell Hashimoto
1fbfc8a664 update Zig nightly 2022-08-02 09:27:05 -07:00
Mitchell Hashimoto
5c8c9d8e3c support DECCOLM
This gets vttest page 1 and page 2 now FULL passing.

We now crash on page 3. This is a lingering bug in our grid code
though and we need to find it anyways so we'll keep the crash in.
2022-07-24 16:06:04 -07:00
Mitchell Hashimoto
3dbe9cba43 clean up unreachables with log statements 2022-07-22 13:54:16 -07:00
Mitchell Hashimoto
d672bedec7 alternate screen buffer (mode 1049) now supported 2022-07-22 13:36:16 -07:00
Mitchell Hashimoto
5564bd7213 cursor belongs to screen (prep for alternate screen) 2022-07-22 13:08:40 -07:00
Mitchell Hashimoto
f445de7568 CSI: Insert Blanks (ESC [ n @) 2022-07-22 09:58:39 -07:00
Mitchell Hashimoto
6641fcbd4c add --font-size flag for font size in pixels 2022-07-21 21:35:49 -07:00
Mitchell Hashimoto
8dbb6343f4 KIND OF handle mode 3 (132 col mode)
This gets vttest looking slightly better on test 1, page 4. It still
isn't correct but we're looking better.
2022-07-15 09:34:17 -07:00
Mitchell Hashimoto
1f12577b8c use packed struct for modes 2022-07-15 09:18:54 -07:00
Mitchell Hashimoto
07d5e3c588 scroll down with no scrollback fixes 2022-07-11 06:53:21 -07:00
Mitchell Hashimoto
f602d09d5d hook up scrolling, kind of works, kind of broke 2022-07-10 17:04:19 -07:00
Mitchell Hashimoto
9f3e6344cc fix build 2022-07-10 15:49:17 -07:00
Mitchell Hashimoto
4b6968e0d1 enable/disable autowrap 2022-07-08 17:43:52 -07:00
Mitchell Hashimoto
d15ab77c3a handle inversion with screen inversion properly 2022-06-30 10:12:46 -07:00
Mitchell Hashimoto
527d8baaa0 invert attribute 2022-06-30 10:05:47 -07:00
Mitchell Hashimoto
bcc6b7604d fix paste outputting "v" 2022-06-26 16:39:48 -07:00
Mitchell Hashimoto
fae36f4e65 reverse colors 2022-06-26 11:56:15 -07:00
Mitchell Hashimoto
96d2de8f60 enq and cursor report with origin mode 2022-06-25 11:04:48 -07:00
Mitchell Hashimoto
245b9642f9 save and restore cursor 2022-06-25 10:56:41 -07:00