4361 Commits

Author SHA1 Message Date
Mitchell Hashimoto
e2772eacec Merge pull request #1846 from kdrag0n/buffered-scrollback-file
scrollback: buffer writes to scrollback file
2024-06-08 14:56:13 -07:00
Mitchell Hashimoto
fb7cbd69c0 core: consider any paste with bracketed paste closer unsafe
Thanks to: https://thejh.net/misc/website-terminal-copy-paste

If a paste has the ending sentinel value for a bracketed paste
("\x1b[201~") then the shell may start processing data faster. We now
consider this unsafe even if the `clipboard-paste-bracketed-safe`
setting is true.
2024-06-08 14:38:49 -07:00
Jeffrey C. Ollie
af9efd4d93 use consistent type for pid 2024-06-08 07:43:44 -06:00
Jeffrey C. Ollie
e6f97c28f8 Use clone3 / CLONE_INTO_CGROUP on Linux
Use clone3 / CLONE_INTO_CGROUP to have the Linux kernel create the process in the
correct cgroup rather than move the process into the cgroup after it is created.
2024-06-07 23:48:03 -06:00
Danny Lin
197b873dee scrollback: buffer writes to scrollback file
Screen.dumpString writes one character at a time, so buffer writes to
the scrollback file to speed it up.
2024-06-07 20:52:08 -07:00
Mitchell Hashimoto
919b00571a font: preload deferred faces in SharedGrid to avoid data races
Fixes #1722

Previously, SharedGrid.getIndex would properly lock any access to search
for and load the face metadata for a font face that contains a
codepoint. However, that face may be "deferred" (metadata loaded but the
actual face not loaded).

Later, outside of the SharedGrid write lock, a deferred face may be
initialized and cause a data race if two threads are doing this at the
same time, sometimes loading to a crash.

This commit fixes the issue by always preloading font indexes in
getIndex because the usage of getIndex implies a very near term future
use of getFace.
2024-06-07 20:35:01 -07:00
Mitchell Hashimoto
0d94fb61c9 terminal: all cursor movement needs to mark the old and new page dirty 2024-06-07 15:03:02 -07:00
Mitchell Hashimoto
c2b0bb6395 terminal: mark old/new rows as dirty when moving the cursor absolute 2024-06-07 14:55:02 -07:00
Mitchell Hashimoto
5092cb55ad Merge pull request #1837 from ghostty-org/titlebar-style
macos: macos-titlebar-style, remove titlebar-tabs option
2024-06-07 13:15:14 -07:00
Mitchell Hashimoto
550a9be241 config: introduce macos-window-shadow 2024-06-07 12:46:14 -07:00
Mitchell Hashimoto
25484d2ccc macos: set background opacity/blur on window controller not surface 2024-06-07 12:31:45 -07:00
Mitchell Hashimoto
4dde7edfab config: macos-titlebar-style, remove titlebar-tabs option
Fixes #1833

This is an attempt to simplify the logic that has organically grown
convoluted over time with regards to how the titlebar and tab bar is
styled.

This field is one unified field that ONLY addresses titlebar and tab bar
styling. It can be one of "native", "transparent", or "tabs". The
"native" field is the new behavior in this commit: it makes the titlebar
and tab bar appearance be absolutely native. We do not color anything
(if we do its a bug).

The "transparent" option is the previous `macos-titlebar-tabs = false`
setting where the titlebar/tab bar is native but colored according to
the window background color.

The "tabs" option is `macos-titlebar-tabs = true`.

The `window-theme = auto` affect on titlebar appearance has been
removed. Now, the titlebar will NEVER be styled with "native" and MAY be
styled with "transparent" and will ALWAYS be styled with "tabs" (since
that's a totally custom look anyways).
2024-06-07 12:12:48 -07:00
Jon Parise
b1e1d8c3eb os: std.ChildProcess -> std.process.Child
std.ChildProcess was deprecated in favor of std.process.Child a few
releases back, and the old name is removed in Zig 0.13.0.
2024-06-07 12:36:30 -04:00
Mitchell Hashimoto
54ccefe838 Merge pull request #1832 from rockorager/csiDispatch-alias
stream: remove redundant alias handling in csiDispatch
2024-06-06 18:40:35 -07:00
Tim Culverhouse
4eddd919ef stream: remove redundant alias handling in csiDispatch
The alias handling block only handles one alias, which is already
handled in the switch statement. Remove this block and rename all
references to 'action' back to 'input'.
2024-06-06 20:15:58 -05:00
Mitchell Hashimoto
be598be6de config: xdg-terminal-exec parsing should ignore the initial "-e" 2024-06-06 14:50:04 -07:00
Mitchell Hashimoto
1093ccecb4 xdg-terminal-exec invocations set title based on command
Fixes #1724

See background in #1724. The general idea is that for Ghostty
invocations via xdg-terminal-exec, we set the initial title to the
command automatically so that window managers can modify the styling.

We only do this for xdg-terminal-exec because that protocol/spec is
specifically for the scenario that the terminal is being used to launch
a command from the desktop environment.
2024-06-06 10:01:32 -07:00
Mitchell Hashimoto
56871c3828 Merge pull request #1828 from ghostty-org/cgroup
Linux: Launch each terminal surface into its own cgroup
2024-06-06 09:28:38 -07:00
Mitchell Hashimoto
dda6a22ea9 apprt/gtk: cgroup hierarchy only affects surfaces 2024-06-05 10:42:43 -07:00
Mitchell Hashimoto
cc6d8bfbfd config: clarify some config 2024-06-05 10:29:01 -07:00
Mitchell Hashimoto
99d567274b config: add cgroup memory limit config 2024-06-05 10:27:53 -07:00
Mitchell Hashimoto
3b41b89c23 apprt/gtk: config to hard fail on cgroup init 2024-06-05 09:47:48 -07:00
Mitchell Hashimoto
ad5d44af10 config: control cgroup isolation 2024-06-05 09:43:57 -07:00
Mitchell Hashimoto
7d9da34259 termio/exec: move subprocess into cgroup 2024-06-05 09:30:21 -07:00
Mitchell Hashimoto
a63c8d0913 termio: plumb a lot more to get ready to move into cgroup 2024-06-05 09:25:36 -07:00
Mitchell Hashimoto
9f1572918f bikeshed style 2024-06-05 09:11:44 -07:00
Jan200101
4220a3bd3a inspector: fallback to unicode when key event is invalid
This prevents non-ascii characters like Ö from being displayed as invalid
2024-06-05 09:10:24 +02:00
Mitchell Hashimoto
dc51b8269c plumb the linux cgroup through to termio 2024-06-04 21:37:34 -07:00
Mitchell Hashimoto
1285b4f243 apprt/gtk: store transient cgroup 2024-06-04 21:10:42 -07:00
Mitchell Hashimoto
01bfce0981 os: cgroup can set memory limits 2024-06-04 21:02:25 -07:00
Mitchell Hashimoto
d351e80158 os: cgroup create/move 2024-06-04 20:22:17 -07:00
Mitchell Hashimoto
bbe525c964 os: API to configure cgroup controllers 2024-06-04 19:36:48 -07:00
Mitchell Hashimoto
b5c4d2f60d os: rename linux => cgroup 2024-06-04 19:28:12 -07:00
Mitchell Hashimoto
c0b061edd9 os: API for listing cgroup controllers 2024-06-04 19:23:18 -07:00
Mitchell Hashimoto
409c958b7e apprt/gtk: cgroup initialization 2024-06-04 18:59:44 -07:00
Mitchell Hashimoto
0a5f3fa0a4 os: add linux API for getting cgroup by pid 2024-06-04 15:15:11 -07:00
Paul Berg
2d9aad9806 gtk: update tab's window upon switching notebook 2024-06-04 09:19:15 +02:00
Mitchell Hashimoto
a502089582 renderer/opengl: don't append assume capacity
Fixes #1815
2024-06-03 20:55:11 -07:00
Mitchell Hashimoto
fdd30725e5 Merge pull request #1823 from jparise/explicit-bash
shell-integration: bash must be explicitly enabled
2024-06-03 18:43:53 -07:00
Mitchell Hashimoto
cd7da9eb4b inspector: fix encoding of pty-encoded key event 2024-06-03 18:40:52 -07:00
Jon Parise
7d7fa46b0c shell-integration: bash must be explicitly enabled
For now, bash integration must be explicitly enabled (by setting
`shell-integration = bash`). Our automatic shell integration requires
bash version 4 or later, and systems like macOS continue to ship bash
version 3 by default. This approach avoids the cost of performing a
runtime version check.
2024-06-03 20:34:29 -04:00
Mitchell Hashimoto
29b3f9d528 gtk: set tab group so that tabs can be dropped onto other windows
Related to #1122
2024-06-03 16:21:50 -07:00
Mitchell Hashimoto
a72a02488f gtk: goto_split:previous/next wrap
Fixes #1258

This matches macOS.
2024-06-03 16:06:24 -07:00
Mitchell Hashimoto
d6f79ce96b gtk: note setting title unhides the cursor 2024-06-03 15:36:10 -07:00
Mitchell Hashimoto
67c17cba1a apprt/gtk: only set cursor on shape change if its visible 2024-06-03 15:07:33 -07:00
Mitchell Hashimoto
30c1ab737c core: only hide mouse on key press events
see comment
2024-06-03 15:04:19 -07:00
Mitchell Hashimoto
ac554c74ff core: do not toggle mouse hidden on keyCallback with mods
If the mouse was hidden, we just keep it hidden.
2024-06-03 14:55:21 -07:00
Mitchell Hashimoto
254608697e Merge pull request #1820 from ghostty-org/gtk
apprt/gtk: when dragging tab out, grab focus
2024-06-03 14:46:14 -07:00
Mitchell Hashimoto
0abb6b9efa apprt/gtk: when dragging tab out, grab focus 2024-06-03 14:40:19 -07:00
Mitchell Hashimoto
86322db991 terminal: point coord y needs to be a larger int
See comment.
2024-06-03 14:25:37 -07:00