2094 Commits

Author SHA1 Message Date
Tim Culverhouse
0231c61a50 termio: reset mouse shape on terminal reset
Reset the mouse shape to `.default` when a full reset is done on the
terminal. Prevents the terminal from appearing to be in a persistent
hang
2023-09-27 20:51:31 -05:00
Mitchell Hashimoto
1dcb23de0f termio/exec: need to defer deinit for DCS command 2023-09-27 14:52:13 -07:00
Mitchell Hashimoto
4724e0dcb4 terminfo: numeric comptime buffer only needs to be 10 bytes 2023-09-27 14:35:22 -07:00
Mitchell Hashimoto
28329761a7 terminfo: xtgettcap map name should use the source name 2023-09-27 14:30:27 -07:00
Mitchell Hashimoto
8208947290 termio/exec: hook up xtgettcap 2023-09-27 14:27:56 -07:00
Mitchell Hashimoto
a02378f969 terminfo: comptime map for xtgettcap results 2023-09-27 14:23:57 -07:00
Mitchell Hashimoto
823f47f695 termio: hook up dcs callbacks 2023-09-27 13:32:00 -07:00
Mitchell Hashimoto
032fcee9ff terminal: DCS handler, XTGETTCAP parsing 2023-09-27 12:07:31 -07:00
Mitchell Hashimoto
850409b9be Merge pull request #550 from mitchellh/locale
Simplify setlocale logic to rely on libc to fail if invalid
2023-09-27 08:02:53 -07:00
Mitchell Hashimoto
35a4427f54 input: 0x7F is a control character, use helper
Fixes #556

One check for control chars was missing 0x7F. Since we do this three
times, extract it to a helper and call that.
2023-09-27 07:57:21 -07:00
Tim Culverhouse
fe0b93389e terminfo: add bracketed paste entries BD, BE, PS, PE
Add terminal entries for bracketed paste mode and start/end signals
2023-09-27 09:20:13 -05:00
Mitchell Hashimoto
767a78020a terminfo: add a few more missing entries from tmux(1) 2023-09-26 22:08:52 -07:00
Mitchell Hashimoto
ece4ddac81 terminfo: OSC 52 support 2023-09-26 21:56:22 -07:00
Tim Culverhouse
6b1d99dc6e terminal: rows created from IND should inherit the current bg attr
Any row created from scrolling via IND ("\x1BD") should have it's
background set as the current background. This can be verified in any
terminal with

  $ echo -e "\x1B[41m" && cat -v"

Followed by pressing enter to scroll the screen. We expect to see red
rows appear. Add test case to verify.

Fixes: alacritty/vim_large_screen_scroll
2023-09-26 22:10:05 -05:00
Mitchell Hashimoto
5c1fbd09cd font: shaper dynamically allocates cell buffer
Pathlogical grapheme clusters can use a LOT of memory, so we need to be
able to grow.
2023-09-26 17:59:16 -07:00
Mitchell Hashimoto
0026c40062 Simplify setlocale logic to rely on libc to fail if invalid
Instead of checking if a locale is valid, let's change this logic:

  1. We first try setlocale to inherit from env vars, system default.
  2. Next, we fall back to unsetting LANG if it was set manually,
     allowing us to fall back to system defaults.
  3. We fall back to en_US.UTF-8.
2023-09-26 17:35:19 -07:00
Mitchell Hashimoto
010338354a core: normalize newlines in non-bracketed pastes
Fixes #547

For non-bracketed paste mode, "\r\n" => "\r" and "\n" => "\r". See the
issue for more supporting documentation.
2023-09-26 14:36:07 -07:00
Mitchell Hashimoto
8c4d25050a apprt/gtk: detect keyboard modifier state for mouse events 2023-09-26 12:37:59 -07:00
Tim Culverhouse
c77f0dc6fc terminfo: add cursor styles to terminfo
Add Ss and Se definitions
2023-09-26 12:53:41 -05:00
Tim Culverhouse
779186adc0 config: add term config option
Add a configuration key for the TERM environment variable. Default this
to "ghostty". Most TEs are using their name as the default TERM value.
Most modern termulators aren't even providing "xterm-" as an alias
anymore, after some drama between kitty / ncurses.

Notably, this also has issues for tcell-based applications (I've
submitted a PR to tcell to fix) because it fails if the TERM value
doesn't match the _primary_ name of the terminal in the terminfo file.

Providing a config option allows users to modify-with-persistence if
they have issues, but Ghostty should be known as Ghostty by default!
2023-09-26 12:53:41 -05:00
Mitchell Hashimoto
db3053c17e config: update docs 2023-09-26 08:53:57 -07:00
Mitchell Hashimoto
b1389cbbfe renderer: support font style changing at runtime 2023-09-26 08:51:04 -07:00
Mitchell Hashimoto
08954feb59 cli: args can parse unions 2023-09-26 08:45:20 -07:00
Mitchell Hashimoto
57d81ba9e1 core: disable styles 2023-09-26 08:39:36 -07:00
Mitchell Hashimoto
6b913bc6bb font: Group can enable/disable styles 2023-09-26 08:37:07 -07:00
Mitchell Hashimoto
4b791f3ee1 renderer: always reset font group on config change 2023-09-26 08:18:11 -07:00
Mitchell Hashimoto
17c0e7f75f config: font style is a union 2023-09-26 08:13:11 -07:00
Mitchell Hashimoto
96f835b78b core: shift does not send mouse events
Fixes #542
2023-09-26 07:52:22 -07:00
Isabella Basso
28322ed304 quirks: CodeNewRoman should disable ligatures by default 2023-09-26 11:10:25 -03:00
Mitchell Hashimoto
3f48a43ba4 terminal: cursors must set pending wrap 2023-09-25 17:42:37 -07:00
Mitchell Hashimoto
2c26071332 terminal: eraseLine resets wrap 2023-09-25 17:32:51 -07:00
Mitchell Hashimoto
1f3138add7 terminal: eraseChars resets wrap 2023-09-25 16:23:29 -07:00
Mitchell Hashimoto
804d252787 terminal: deleteChars resets pending wrap state 2023-09-25 16:21:04 -07:00
Mitchell Hashimoto
27cc8e5529 terminal: insertLines resets wrap 2023-09-25 16:17:22 -07:00
Mitchell Hashimoto
961e836d67 terminal: DL should reset wrap 2023-09-25 16:13:07 -07:00
Tim Culverhouse
cfdce572b9 screen: only use bg attr for inserted rows
When scrolling up or deleting lines (effectively the same operation),
the inserted lines should only inherit the bg attribute of the cursor.
This behavior is similar to erase display and erase line. Update tests
to reflect this behavior.
2023-09-25 16:07:48 -05:00
Tim Culverhouse
5d598e4e33 terminal: only use bg attr when erasing line
Similar to eraseDisplay semantics, erase line should only apply the bg
attr to erased cells.
2023-09-25 16:07:48 -05:00
Tim Culverhouse
da6dfbbf3d terminfo: add Setulc string for colored underlines
Add terminfo key 'Setulc' to enable colored underlines.
2023-09-25 15:54:03 -05:00
Mitchell Hashimoto
e1d66da1b6 Merge pull request #536 from mitchellh/protected-mode
DEC Protected Mode (DECSCA, DECSEL, DECSED)
2023-09-25 11:57:05 -07:00
Mitchell Hashimoto
35f89bd28c terminal: eraseDisplay protected 2023-09-25 11:16:06 -07:00
Tim Culverhouse
3d5180a177 terminal: use ST instead of BEL terminator for XTVERSION
The XTVERSION response should use a string terminator instead of a bell.
Most terminals can handle the bell, however specifically tmux does not
like it.

Fixes: #534
2023-09-25 13:08:31 -05:00
Mitchell Hashimoto
f1c771615f terminal: eraseLine protected, tests 2023-09-25 10:56:59 -07:00
Mitchell Hashimoto
5528580a29 terminal: DECSED, DECSEL parsing, tests 2023-09-25 10:56:59 -07:00
Mitchell Hashimoto
8137a66ef6 terminal: CSI Ps " q for setting DEC protected mode 2023-09-25 10:56:59 -07:00
Mitchell Hashimoto
2a390785f5 terminal: add protected mode flag to cursor pen 2023-09-25 10:56:57 -07:00
Tim Culverhouse
3264e70701 terminal: don't modify pen state when erasing eraseDisplay
Erasing the display should be done with only the background attribute of
the current pen. This is the current behavior but is done by altering
the current pen state. The pen state should remain after erasure. Use a
new pen variable to erase the display to enable retaining the pen state.
Add a test condition.
2023-09-25 12:25:45 -05:00
Tim Culverhouse
b592b069c8 terminal: retain cursor and charset when entering alt screen
The state of the cursor and charset should be retained when entering the
alternate screen.

Fixes: alacritty/save_cursor_alt
2023-09-25 11:42:01 -05:00
Tim Culverhouse
66875206bb terminal: move charset to screen
Each screen (primary and alternate) retains the state of the current
charset when DECSC (save cursor) is called. Move the CharsetState into
the screen to enable saving the state with each screen.

Add a test for charset state on screen change
2023-09-25 10:43:39 -05:00
Mitchell Hashimoto
601ca5e7de Merge pull request #531 from mitchellh/codepoint-map
Specify font for specific codepoint ranges
2023-09-24 21:06:51 -07:00
Mitchell Hashimoto
7a9a36ecb0 config: remove unused test, make parse test more intense 2023-09-24 20:49:53 -07:00