220 Commits

Author SHA1 Message Date
Mitchell Hashimoto
63fa34ef6b terminal: avoid underflow on resize, tests added 2023-08-12 11:30:07 -07:00
Mitchell Hashimoto
71c8d5fc8e terminal: resizing to 1 col wide with wide chars 2023-08-12 10:23:06 -07:00
Mitchell Hashimoto
44dd51a5b9 terminal: less col resizing with wide char needs to insert head spacer 2023-08-12 10:07:13 -07:00
Mitchell Hashimoto
eb10e9642c terminal: introduce wide spacer head if reflowing wide char w/ more cols 2023-08-12 09:51:33 -07:00
Mitchell Hashimoto
3d5eda62fe terminal: resize more cols with wide spacer head across multiple lines 2023-08-12 08:26:13 -07:00
Mitchell Hashimoto
a6af75aee4 terminal: resize more cols with wide spacer head deletes the spacer 2023-08-12 08:20:10 -07:00
Mitchell Hashimoto
3d72178ef4 terminal: delete wide char if it wraps and we delete the row above 2023-08-11 16:23:02 -07:00
Mitchell Hashimoto
8bb69045a8 terminal: allow selections outside of written area and clamp
This fixes a possible crash.
2023-08-11 14:21:07 -07:00
Kevin Hovsäter
22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto
a890cc3a5b terminal: add screen.dumpString 2023-07-09 11:52:37 -07:00
Mitchell Hashimoto
de66d4925a terminal: rename scroll "delta/delta_no_grow" to screen/viewport 2023-07-08 13:47:16 -07:00
Mitchell Hashimoto
1a94f6ba7d terminal: do not scroll viewport if new lines are added while scrolled 2023-07-08 13:42:00 -07:00
Mitchell Hashimoto
b3b19997ea terminal: scroll to row always tries to get it to the top 2023-07-06 10:31:47 -07:00
Mitchell Hashimoto
9f86c48fd8 keybinding jump_to_prompt for semantic prompts 2023-07-06 10:30:29 -07:00
Mitchell Hashimoto
b542f7e3c4 terminal: jump to prompt core methods 2023-07-06 10:16:07 -07:00
Mitchell Hashimoto
738c4dff4c clear_screen keybinding works even when not at shell prompt
Instead of sending formfeed (0x0C), clear_screen actually does a
terminal emulator level clear instead. This MOSTLY matches the behavior
of iTerm and Terminal.app, with some differences:

  1. I do not clear _below_ the cursor. I feel like the use case for
     this feature is primarily to clear above the cursor. Happy to be
     wrong here but I want it proven to me!

  2. I do not clear in alternate screen mode. Clearing alt screens
     breaks rendering in Vim, less, etc. and it feels like the wrong
     behavior.
2023-07-05 14:01:01 -07:00
Mitchell Hashimoto
314f9287b1 Update Zig (#164)
* update zig

* pkg/fontconfig: clean up @as

* pkg/freetype,harfbuzz: clean up @as

* pkg/imgui: clean up @as

* pkg/macos: clean up @as

* pkg/pixman,utf8proc: clean up @as

* clean up @as

* lots more @as cleanup

* undo flatpak changes

* clean up @as
2023-06-30 12:15:31 -07:00
Mitchell Hashimoto
56f8e39e5b Update zig, mach, fmt 2023-06-25 11:08:20 -07:00
Mitchell Hashimoto
c6356930cc renderer: support invisible attribute 2023-06-25 09:31:33 -07:00
Mitchell Hashimoto
8d40fba9ce terminal: correct assertion for scrollUp 2023-06-23 14:06:40 -07:00
Mitchell Hashimoto
860209e968 terminal: track underline color on cell 2023-06-20 09:37:58 -07:00
Mitchell Hashimoto
e26cb46f4a terminal: tests for semantic prompt on resize 2023-05-31 16:20:30 -07:00
Mitchell Hashimoto
414f2e52a5 terminal: semantic prompt aware resize 2023-05-31 16:16:00 -07:00
Mitchell Hashimoto
4047a90555 terminal: track semantic prompt metadata per row 2023-05-27 15:45:51 -07:00
Mitchell Hashimoto
b196e43ee4 fix some issues for future Zig update 2023-05-19 08:34:07 -07:00
Mitchell Hashimoto
97d9157d22 update zig version 2023-05-07 20:50:51 -07:00
Mitchell Hashimoto
5225836415 terminal: selectWord stops at single/double quote boundaries 2023-03-23 10:48:03 -07:00
Mitchell Hashimoto
70236ebc33 terminal: screen scroll with full scrollback modifies selection 2023-03-21 10:59:44 -07:00
Mitchell Hashimoto
dfb40426a0 move selection to screen 2023-03-21 10:43:50 -07:00
Mitchell Hashimoto
54d6654d8b terminal: selectLine can select last line with scrollback
We had incorrect logic around when the line you want to select is the
last line and it crashed. A new test case covers this.
2023-03-17 11:07:43 -07:00
Mitchell Hashimoto
4ececc8923 screen: resize rows should use old cols value 2023-03-02 13:46:58 -08:00
Mitchell Hashimoto
ba96a2c023 screen: adding cols doesn't mess with the viewport
This was untested anyways, and the result was bugs!
2023-03-01 22:14:19 -08:00
Mitchell Hashimoto
28378a350d screen: shrinking cols trims trailing blank lines 2023-03-01 22:01:42 -08:00
Mitchell Hashimoto
05fe2a83b1 terminal: erase display below should unwrap soft wrapped state 2023-03-01 21:30:31 -08:00
Mitchell Hashimoto
56cb1dd55b screen: correct cursor position with scrollback and less cols 2023-03-01 21:06:33 -08:00
Mitchell Hashimoto
979dc5a439 screen: redo resizing to less columns
This is more performant (prefers fast copies if no wrapping) and keeps
track of the cursor more accurately.
2023-03-01 20:59:35 -08:00
Mitchell Hashimoto
3b586c39c5 screen: grow cols before rows to handle reflow (tested) 2023-03-01 19:45:39 -08:00
Mitchell Hashimoto
74f0e38b57 screen: only trim if we're not wrapping on col growing 2023-03-01 17:42:46 -08:00
Mitchell Hashimoto
9a4a138da0 screen: don't wrap empty-char stylized cells on shrinking cols 2023-03-01 17:34:17 -08:00
Mitchell Hashimoto
31ac3ec7ba screen: when expanding cols, broadcast empty styled cells 2023-03-01 17:24:24 -08:00
Mitchell Hashimoto
89138cf7e3 screen: don't trim blank lines if rows aren't changing 2023-03-01 17:09:57 -08:00
Mitchell Hashimoto
b4d8419feb screen: trim trailing no-character cells when rows is changing
This matches Terminal.app, and makes it so the `ESC [ J` doesn't
generate scrollback on rows change.
2023-03-01 17:07:07 -08:00
Mitchell Hashimoto
d4057522ee screen: resize more rows preserves soft wrapped flag 2023-03-01 09:18:26 -08:00
Mitchell Hashimoto
5f9ab91466 screen: fix issue with resizing w/ more cols, reflow, and scrollback 2023-03-01 09:08:08 -08:00
Mitchell Hashimoto
1970a84960 screen: when resizing and trimming scrollback, have to offset cursor Y
When the scrollback is trimmed off the top, the y stops moving. This
would cause an assertion failure because y could be greater than the row
count! The test case tests this.
2023-02-28 22:28:27 -08:00
Mitchell Hashimoto
87e0f5589f screen clone should not make full requested height "written"
Previously, the screen clone would incidentally mark the full height as
"written" which would cause resize to create scrollback because it was
trying to preserve prior rows. A clone should not "write" any data. This
modifies the clone operation to create a screen with the correct height
but only copy data actually written.
2023-02-28 17:10:28 -08:00
Mitchell Hashimoto
ce86c64b42 update zig, src for loops 2023-02-27 21:46:42 -08:00
Mitchell Hashimoto
4fae29ff13 terminal: scrollRegionUp outside of range does nothing 2022-12-14 21:43:47 -08:00
Mitchell Hashimoto
c7a28fab20 terminal: don't crash if cell claims to have grapheme but doesn't 2022-12-14 21:19:23 -08:00
Mitchell Hashimoto
29cc8312d5 revert 2022-11-27 21:45:10 -08:00