5905 Commits

Author SHA1 Message Date
Mitchell Hashimoto
34fb840cf9 terminal: search match on overlap case 2024-12-04 11:16:45 -08:00
Mitchell Hashimoto
852e04fa00 terminal: test for match in second slice of circ buf 2024-12-04 10:58:38 -08:00
Mitchell Hashimoto
af1ee4d95f terminal: search match across page boundary 2024-12-04 10:36:22 -08:00
Mitchell Hashimoto
79026a1148 terminal: test no match pruning 2024-12-03 15:55:18 -08:00
Mitchell Hashimoto
09e4cccd2c terminal: remove unused pagesearch 2024-12-03 15:53:13 -08:00
Mitchell Hashimoto
b487aa8e1f terminal: search across two pages and pruning appears to be working 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
d307b02e40 terminal: sliding window search can move the cursor 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
6ed298c9c1 terminal: sliding window search starts working 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
2a13c6b6a3 terminal: working on a pagelist sliding window for search 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
8abbd80e06 CircBuf: add ensureUnusedCapacity, appendSlice 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
eaddb69500 datastruct: CircBuf can be initialized empty 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
61c5fb8115 terminal: single pagelist node search 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
204e4f8663 terminal: support cell_map for encodeUtf8 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
bcefbfd7b4 terminal: move UTF8 encoding to Page and wrap around it 2024-12-03 15:53:12 -08:00
Mitchell Hashimoto
e712314f31 terminal: PageList.reset has to zero arena memory to avoid reuse
Fixes #2877

As the comment in the diff states, we rely on `mmap` to zero our memory.
When we reset we are reusing previously allocated memory so we won't hit
an `mmap`. We need to zero the memory ourselves.

This is pretty slow if there is a lot of memory but in every case except
allocation failures, we expect there to be only a few pages allocated.
2024-12-03 08:58:57 -05:00
Mitchell Hashimoto
212bd3d5fb terminal: fullReset uses the new screen reset methods 2024-12-02 17:44:07 -05:00
Mitchell Hashimoto
d7fcaefdf3 terminal: PageList.reset 2024-12-02 17:26:19 -05:00
Mitchell Hashimoto
d57d1d2395 terminal: failing tracked pin test on fullReset 2024-12-02 09:39:43 -05:00
DeftDawg
1e5b02302b - Add alt keybindings for ctrl+ins = Copy and shift+ins = Paste for non-MacOS systems 2024-12-02 02:47:42 -05:00
Valentin Shinkarev
e7bfc17318 fix slow scroll in mouseReport 2024-12-01 22:58:46 +03:00
Mitchell Hashimoto
853ba9e3c7 terminal: reset should preserve desired default mode values
Fixes #2857

Some terminal modes always reset, but there are others that should be
conditional based on how the terminal's default state is configured.
Primarily from #2857 is the grapheme clustering mode (mode 2027) which
was always resetting to false but should be conditional based on the
the `grapheme-width-method` configuration.
2024-11-29 14:42:01 -08:00
Mitchell Hashimoto
ffb5fff555 Merge pull request #2856 from ghostty-org/push-nmsumxnrsyrq
macos: unicode keybindings must convert to string properly
2024-11-29 14:31:19 -08:00
Mitchell Hashimoto
9ac929ef8e macos: unicode keybindings must convert to string properly
Fixes #2848

The proper way to convert a unicode scalar in Swift is to use the
`String` initializer that takes a `UnicodeScalar` as an argument. We
were converting a number to a string before, which is incorrect.
2024-11-29 14:21:46 -08:00
Mike Hartington
df4a6f2161 font/sprite: add missing chevron powerline fonts 2024-11-29 14:26:22 -05:00
Mitchell Hashimoto
423f58c24c Merge pull request #2843 from ghostty-org/push-lqkuvlyttoul
config: need to dupe filepath for diagnostics
2024-11-27 08:51:51 -08:00
Mitchell Hashimoto
5b01cb353d config: need to dupe filepath for diagnostics
Fixes #2800

The source string with the filepath is not guaranteed to exist beyond
the lifetime of the parse operation. We must copy it.
2024-11-27 08:46:47 -08:00
Mitchell Hashimoto
ba4185f6b7 macos: disable background opacity/blur in native fullscreen
See #2840
2024-11-27 08:35:13 -08:00
Mitchell Hashimoto
abafb81a1b apprt/gtk: update app color scheme state
Fixes #2781

This commit contains two separate changes but very related:

1. We update the color scheme state of the app on app start. This is
   necessary so that the configuration properly reflects the conditional
   state of the theme at the app level (i.e. the window headerbar).

2. We take ownership of the new config when it changes, matching macOS.
   This ensures that things like our GTK headerbar update when the theme
   changes but more generally whenever any config changes.

And some housekeeping:

- We remove runtime CSS setup from init. We can do it on the first tick
  of `run` instead. This will probably save some CPU cycles especially
  when we're just notifying a single instance to create a new window.

- I moved dbus event setup to `run` as well. We don't need to know these
  events unless we're actually running the app. Similar to the above,
  should save some CPU time on single instance runs.
2024-11-26 19:13:36 -08:00
Mitchell Hashimoto
a482224da8 renderer: set QoS class of the renderer thread on macOS
This sets the macOS QoS class of the renderer thread. Apple
recommends[1] that all threads should have a QoS class set, and there
are many benefits[2] to that, mainly around power management moreso than
performance I'd expect.

In this commit, I start by setting the QoS class of the renderer thread.
By default, the renderer thread is set to user interactive, because it
is a UI thread after all. But under some conditions we downgrade:

  - If the surface is not visible at all (i.e. another window is fully
    covering it or its minimized), we set the QoS class to utility. This
    is lower than the default, previous QoS and should help macOS
    unschedule the workload or move it to a different core.

  - If the surface is visible but not focused, we set the QoS class to
    user initiated. This is lower than user interactive but higher than
    default. The renderer should remain responsive but not consume as
    much time as it would if it was user interactive.

I'm unable to see any noticable difference in anything from these
changes. Unfortunately it doesn't seem like Apple provides good tools to
play around with this.

We should continue to apply QoS classes to our other threads on macOS.

[1]: https://developer.apple.com/documentation/apple-silicon/tuning-your-code-s-performance-for-apple-silicon?preferredLanguage=occl
[2]: https://blog.xoria.org/macos-tips-threading/
2024-11-26 15:43:35 -08:00
Mitchell Hashimoto
2e939b617e config: clone should copy diagnostics
Fixes #2800
2024-11-26 15:13:32 -08:00
Mitchell Hashimoto
e20b27de84 terminal: eraseChars was checking wide char split boundary on wrong cell
Fixes #2817

The test is pretty explanatory. I also renamed `end` to `count` since I
think this poor naming was the reason for the bug. In `eraseChars`, the
`count` (nee `end`) is the number of cells to erase, not the index of
the last cell to erase.
2024-11-26 14:29:58 -08:00
Mitchell Hashimoto
204c5796a7 Merge pull request #2825 from StratusFearMe21/gtk-startup
Prevent GTK from initializing Vulkan. This improves startup time
2024-11-26 13:24:16 -08:00
Mitchell Hashimoto
e3621e81b7 apprt/gtk: use proper env var for vulkan disable on <= 4.14 2024-11-26 13:18:05 -08:00
Mitchell Hashimoto
9171cb5c29 config: implement clone for RepeatableLink
Fixes #2819
2024-11-26 10:50:13 -08:00
Isaac Mills
39fbd7db4b Prevent GTK from initializing Vulkan. This improves startup time 2024-11-26 11:10:00 -07:00
Gregory Anders
2cbc2833d1 termio: fixes to kitty color reporting
The kitty color report response is an OSC, not a CSI, so change `[` to
`]`. Colors which are unset should be reported with `{key}=`.
2024-11-26 09:01:31 -06:00
Mitchell Hashimoto
518f8b1048 Merge pull request #2797 from kyswtn/application-support-dir
Support loading config from "Application Support" directory on macOS
2024-11-25 16:15:59 -08:00
Mitchell Hashimoto
b9345e8d6a try to abstract bundle ID to a zig file 2024-11-25 16:11:02 -08:00
Mitchell Hashimoto
adc59be977 os: more error handling on reading the app support dir 2024-11-25 16:04:41 -08:00
Mitchell Hashimoto
a39aa7e89d apprt/gtk: only show config reload toast if app config changes
This resolves the toast showing up every time the surface config changes
which can be relatively frequent under certain circumstances such as
theme changes.
2024-11-25 15:13:23 -08:00
Mitchell Hashimoto
6c615046ba config: only change conditional state if there are relevant changes
Related to #2775

This makes it so that `changeConditionalState` only does something if
the conditional state (1) has changes and (2) those changes are relevant
to the current conditional state.

By "relevant" we mean that the conditional state being changed is state
that is actually used by the configuration.
2024-11-25 13:55:16 -08:00
Mitchell Hashimoto
4c2d462000 Merge pull request #2796 from anmolw/fish-completions-themes
Strip theme location in fish completions
2024-11-24 09:44:56 -08:00
Kyaw
10e37a3dee config: support loading from "Application Support" directory on macOS 2024-11-24 17:08:07 +07:00
Anmol Wadhwani
2d3709f354 Strip theme location in fish completions
Co-authored-by: trag1c <trag1cdev@yahoo.com>
2024-11-24 12:11:41 +05:30
Gregory Anders
4042041b61 termio: track whether fg/bg color is explicitly set
Make the foreground_color and background_color fields in the Terminal
struct optional values so that we can determine if a foreground or
background color was explicitly set with an OSC 10 or OSC 11 sequence.
This makes the logic a bit simpler to reason about (i.e.
`foreground_color` is now always "the color set by an OSC 10 sequence"
while `default_foreground_color` is always "the color set by the config
file") and also fixes an issue where an OSC 10 or OSC 11 query would not
report the correct color after a config update changed the foreground or
background color.

The `cursor_color` field was already optional, with the same semantics
(it is only non-null when explicitly set with an OSC 12) so this brings
all three of these fields into alignment.
2024-11-23 19:48:24 -06:00
Mitchell Hashimoto
e031eb17f4 config: clone() needs to preserve conditionals of replay steps
Fixes #2791

This goes back to the previous implementation of clone that directly
cloned values rather than using replay steps, because replay steps don't
preserve conditionals on the iterator.

This works.

Another fix will be when we support some sort of conditional syntax and
the replay iterator can yield that information. We have a unit test here
so we can verify that then.
2024-11-23 15:22:05 -08:00
Mitchell Hashimoto
f7e1d0b83b apprt/embedded: update our cached config on config_change action
Fixes #2784
2024-11-23 10:22:11 -08:00
Mitchell Hashimoto
dca3cd7c10 Merge pull request #2788 from ghostty-org/push-rxpmmzxptqwt
surface needs to preserve original config working-directory
2024-11-23 10:05:16 -08:00
Mitchell Hashimoto
2b30186259 surface needs to preserve original config working-directory
Fixes #2785
2024-11-23 09:54:19 -08:00
Mitchell Hashimoto
6658aae21f Merge pull request #2771 from ghostty-org/push-quwzwysosskr
mode 2031 should send updates on any color palette change
2024-11-23 09:53:53 -08:00