448 Commits

Author SHA1 Message Date
Mitchell Hashimoto
f2513e0825 Merge pull request #876 from gpanders/notifications
Add support for desktop notifications
2023-11-17 21:57:09 -08:00
Mitchell Hashimoto
54d4aed762 Merge pull request #899 from Raiden1411/select-all
core: implement select all binding
2023-11-17 21:37:57 -08:00
Raiden1411
e3b83249d6 core: implement select all binding 2023-11-17 18:01:39 +00:00
Krzysztof Wolicki
44a48f62f1 change unmodified vars to consts in anticipation of zig changes 2023-11-17 15:46:46 +01:00
Gregory Anders
5290070be9 clipboard: add Clipboard variant for primary clipboard
In practice, the primary and selection clipboards are treated exactly
the same, but this allows OSC 52 sequences to use either 's' or 'p' as
the clipboard target.
2023-11-16 16:35:48 -06:00
Mitchell Hashimoto
df99c6e8e0 core: comment out log statements 2023-11-15 10:57:51 -08:00
Mitchell Hashimoto
50f0aaf26b renderer/metal: support multi-codepoint preedit text 2023-11-15 09:49:28 -08:00
Gregory Anders
689199251a core: use arrays instead of WriteReq for desktop notifications 2023-11-15 11:21:30 -06:00
Gregory Anders
3f4ea2f763 core: support OSC 9 and OSC 777 for showing desktop notifications 2023-11-15 10:25:02 -06:00
Mitchell Hashimoto
5001e2c60c macos: filter option in AppKit when option-as-alt set
Fixes #872

In #867 we fixed macos-option-as-alt, but unfortunately AppKit ALSO does
some translation so some behaviors were not working correctly.
Specifically, when you had macos-option-as-alt set, option+e would
properly send `esc+e` to the pty but it would ALSO set the dead key
state for "`" since AppKit was still translating the option key.

This commit introduces a function to strip alt when necessary from the
translation modifiers used at the AppKit layer, preventing this
behavior.
2023-11-13 13:26:37 -08:00
Mitchell Hashimoto
86fbc6a85b macos-option-as-alt works again
This regressed sometime -- I can't find the exact commit -- but in any
case I've moved this handling directly into the KeyEncoder so we can
unit test it and prevent future regressions.
2023-11-12 15:26:55 -08:00
Mitchell Hashimoto
af6cc66369 core: Fix various double-click word selection bugs
Fixes #741

This completely reimplements double-click-and-drag logic for selecting
by word. The previous implementation was horribly broken. See #741 for
all the details.

The implemented logic now is:

* A double-click initiates a select-by-word selection mechanism.
  - A double-click may start on a word or whitespace
  - If the initial double-click is on a word, that word is immediately selected.
  - If the initial double-click is on whitespace, the whitespace is not selected.
* A "word" is determined by a non-boundary character meeting a boundary character.
  - A boundary character is `NUL` ` ` (space) `\t` `'` `"`
  - This list is somewhat arbitrary to make the terminal "feel" good.
  - Cell SGR states (fg/bg, bold, italic, etc.) have no effect on boundary determination or selection logic.
* As the user drags _on the same line_:
  - No selection change occurs until the cursor is over a new word. Whitespace change does nothing.
  - When selection is over a new word, that entire word added to the selection.
* When the user drags _up_ one or more lines:
  - If the cursor is over whitespace, all lines from the selection point up to but not including the cursor line are selected.
    * This selection is done in accordance to the previous rules.
  - If the cursor is over a word, the word becomes the beginning of the selection.
  - The end of the selection in all cases is the first word at or before the initial double-click point.
* When the user drags _down_ one or more lines:
  - The same logic as _up_ but swap the "beginning" and "end" of selection terminology.
* With this logic, the behavior of Ghostty has the following invariants:
  - Whitespace is never selected unless it is between two selected words
  - Selection implies at least one word is highlighted
  - The initial double-click point marks the beginning or end of a selection, never the middle.
2023-11-11 22:45:31 -08:00
Mitchell Hashimoto
2489ef4c13 stylistic tweaks 2023-11-11 15:15:52 -08:00
Gregory Anders
06cdbc1a96 config: export ClipboardAccess 2023-11-11 17:25:48 -05:00
Gregory Anders
2a64180ebd config: rename ClipboardRequest to ClipboardAccess 2023-11-10 23:12:39 -05:00
Gregory Anders
960a1bb091 gtk: implement OSC 52 prompts 2023-11-10 23:12:39 -05:00
Gregory Anders
86245ff0cf macos: add option to prompt user for confirmation on OSC 52 commands 2023-11-10 23:12:39 -05:00
Mitchell Hashimoto
ce4541dd61 core, renderer: handle wide preedit chars
Fixes #855
2023-11-10 17:26:36 -08:00
Mitchell Hashimoto
3d8dd0783a font: if VS15/16 not specified, prefer any presentation in explicit font
Fixes #845

Quick background: Emoji codepoints are either default text or default
graphical ("Emoji") presentation. An example of a default text emoji
is ❤. You have to add VS16 to this emoji to get: ❤️. Some font are
default graphical and require VS15 to force text.

A font face can only advertise text vs emoji presentation for the entire
font face. Some font faces (i.e. Cozette) include both text glyphs and
emoji glyphs, but since they can only advertise as one, advertise as
"text".

As a result, if a user types an emoji such as 👽, it will fallback to
another font to try to find a font that satisfies the "graphical"
presentation requirement. But Cozette supports 👽, its just advertised
as "text"!

Normally, this behavior is what you want. However, if a user explicitly
requests their font-family to be a font that contains a mix of test and
emoji, they _probably_ want those emoji to be used regardless of default
presentation. This is similar to a rich text editor (like TextEdit on
Mac): if you explicitly select "Cozette" as your font, the alien emoji
shows up using the text-based Cozette glyph.

This commit changes our presentation handling behavior to do the
following:

  * If no explicit variation selector (VS15/VS16) is specified,
    any matching codepoint in an explicitly loaded font (i.e. via
    `font-family`) will be used.

  * If an explicit variation selector is specified or our explicitly
    loaded fonts don't contain the codepoint, fallback fonts will be
    searched but require an exact match on presentation.

  * If no fallback is found with an exact match, any font with any
    presentation can match the codepoint.

This commit should generally not change the behavior of Emoji or VS15/16
handling for almost all users. The only users impacted by this commit
are specifically users who are using fonts with a mix of emoji and text.
2023-11-08 21:55:20 -08:00
Gregory Anders
cd01340cce macos: add key binding for equalizing split sizes 2023-11-07 16:23:28 -06:00
Mitchell Hashimoto
d20c4866b1 some comments, make switch exaustive 2023-11-06 14:42:10 -08:00
Tim Culverhouse
9a64697433 mouse: set mouse to text when bypassing mouse reporting
When shift is held, we are bypassing mouse reporting mode. Change the
cursor to text to indicate this to the user. On release, change back to
whatever we were before.
2023-11-06 14:36:59 -08:00
Mitchell Hashimoto
4e3ab4879d Merge pull request #822 from gpanders/split-resizing
macos: implement split resizing
2023-11-06 09:35:43 -08:00
Mitchell Hashimoto
f8b0654a19 Merge pull request #816 from Raiden1411/feat/options
feat: add support for `--fullscreen`, `--title` and `--class` values
2023-11-06 08:55:33 -08:00
Mitchell Hashimoto
3564dd5e7e stylistic changes 2023-11-06 08:47:09 -08:00
Raiden1411
d2d5d4ba82 chore: cleanup 2023-11-06 14:27:36 +00:00
Raiden1411
232527c9dc fix: fullscreen on new windows 2023-11-06 11:59:16 +00:00
Raiden1411
7fa712ab2b chore: more comment changes 2023-11-06 11:32:25 +00:00
Raiden1411
094f8effa3 fix: begin implementation of suggested changes 2023-11-06 10:19:09 +00:00
Gregory Anders
0a2d435481 core: add resize_split binding with default keys
On macOS, use Cmd+Ctrl+Arrow keys as default bindings for resizing by 10
points in the given direction.
2023-11-05 20:20:39 -06:00
Mitchell Hashimoto
74b840df8e rename Pty.zig to pty.zig 2023-11-05 23:41:45 +00:00
kcbanner
232df8de8f windows: add support for the glfw backend on Windows
Changes:
- Add WindowsPty, which uses the ConPTY API to create a pseudo console
- Pty now selects between PosixPty and WindowsPty
- Windows support in Command, including the ability to launch a process with a pseudo console
- Enable Command tests on windows
- Add some environment variable abstractions to handle the missing libc APIs on Windows
- Windows version of ReadThread
2023-11-05 23:15:49 +00:00
Mitchell Hashimoto
705f3b52c7 config: add clipboard-paste-bracketed-safe 2023-11-05 09:25:06 -08:00
Mitchell Hashimoto
f521b0cb99 core: not unsafe on bracketed 2023-11-05 09:20:27 -08:00
Mitchell Hashimoto
ef44551522 apprt/embedded: hook up paste confirmation 2023-11-05 09:20:16 -08:00
Raiden1411
467b840bcf glfw: send warning for fullscreen 2023-11-05 15:19:29 +00:00
Raiden1411
19afbb90a7 fix: glfw build 2023-11-05 14:06:33 +00:00
Raiden1411
dff3ce6eb5 chore: add targets 2023-11-05 13:26:51 +00:00
Raiden1411
aa62d78fc2 chore: add log to setTitle 2023-11-05 12:03:08 +00:00
Raiden1411
d45415c8bf more match fixes 2023-11-05 12:01:11 +00:00
Raiden1411
17c6496855 fix: match main 2023-11-05 11:58:44 +00:00
Raiden1411
9e9ad67d3c feat: add support for fullscreen, title and class values 2023-11-05 11:49:25 +00:00
Mitchell Hashimoto
06a469fc4b core: do not consider bracketed pastes unsafe 2023-11-04 12:08:34 -07:00
Mitchell Hashimoto
a38220eade terminal: move sanitization check to this package, unit test 2023-11-04 11:19:25 -07:00
David Rubin
65c9ba0a86 add todos + make sure non-implimented platforms still work. 2023-11-04 00:50:26 -07:00
David Rubin
a578ec342f forgot to update other backends 2023-11-03 14:20:24 -07:00
David Rubin
6e575d9035 configs added 2023-11-03 13:20:26 -07:00
David Rubin
44073e4c98 add basic functionality 2023-11-03 10:58:56 -07:00
Lukáš Dvořák
8774a73302 update comment 2023-11-03 18:30:42 +01:00
Lukáš Dvořák
5224b6157c fix: posToViewPort when using balanced padding enabled 2023-11-03 18:28:34 +01:00