Commit Graph

277 Commits

Author SHA1 Message Date
benodiwal
3d0da44e15 feat(config): allow fullscreen config to specify non-native mode directly
Co-Authored-By: Sachin <sachinbeniwal0101@gmail.com>
2026-02-19 14:34:22 -08:00
Priyanshu
de49b7f27b rename copy_title action to copy_title_to_clipboard 2026-02-13 09:59:02 +05:30
Priyanshu
b4be13ed50 fix: copy_title_to_clipboard now respects user-overridden title
When a user renames a surface via "Change Terminal Title" and then
uses copy_title_to_clipboard, the raw terminal title was copied
instead of the custom name.

This adds a new `copy_title` apprt action so each platform resolves
the effective title (user override or terminal-set) before copying
to clipboard.

Fixes #10345
2026-02-13 01:19:15 +05:30
Mitchell Hashimoto
3f006f86a3 lib-vt: fix up the OSC command keys 2026-01-23 14:42:05 -08:00
Lars
9c5d4a5511 ghosttyKit: add ghostty_config_load_file 2026-01-20 09:15:14 -08:00
Tim Culverhouse
5ee56409c7 macos: support mouse buttons 8/9 (back/forward)
Add support for mouse buttons 4-11 in the macOS app. Previously only
left, right, and middle buttons were handled. Now otherMouseDown/Up
events properly map NSEvent.buttonNumber to the corresponding Ghostty
mouse button, enabling back/forward button support.

Fixes: https://github.com/ghostty-org/ghostty/issues/2425
Amp-Thread-ID: https://ampcode.com/threads/T-019bd74e-6b2b-731d-b43a-ac73b3460c32
Co-authored-by: Amp <amp@ampcode.com>
2026-01-19 11:59:50 -06:00
Mitchell Hashimoto
856ef1fc1b input: change the key_is_binding to return some information 2026-01-09 06:51:48 -08:00
Leah Amelia Chen
c559a1dbba Allow for default or inherited CWD in new window, tab and split surfaces (redone for GTK-NG) (#9158) 2026-01-07 20:45:06 +08:00
Mitchell Hashimoto
8e28f58b42 rename the selection search binding, unify into start_search action 2026-01-06 14:10:42 -08:00
Aaron Ruan
9b6a3be993 macOS: Selection for Find feature
Adds the `selection_for_search` action, with Cmd+E keybind by default.
This action inputs the currently selected text into the search
field without changing focus, matching standard macOS behavior.
2026-01-06 22:21:55 +08:00
Peter Guy
d660799723 Consolidate the several ghostty_surface_inherited_config
functions back into a single function with a second parameter for the source context.
2026-01-05 16:47:04 -08:00
Peter Guy
c035fb5385 Add an enum type for the C API 2026-01-05 16:47:04 -08:00
Peter Guy
dba0ff5339 Add C API function to handle new surfaces of different types 2026-01-05 16:47:04 -08:00
Peter Guy
7cf4c8dc53 Add context field to C config struct 2026-01-05 16:47:04 -08:00
Mitchell Hashimoto
14f592b8d4 macOS: Don't duplicate command palette entries for terminal commands
This is a regression introduced when we added macOS support for custom
entries. I mistakingly thought that only custom entries were in the
config, but we do initialize it with all!
2025-12-26 11:03:50 -08:00
Mitchell Hashimoto
017021787c config: RepeatableCommand cval 2025-12-24 14:26:47 -08:00
Mitchell Hashimoto
44972198ae apprt: add action for key table activation/deactivation 2025-12-20 19:53:12 -08:00
Mitchell Hashimoto
63422f4d4e add the catch_all binding key
Part of #9963

This adds a new special key `catch_all` that can be used in keybinding
definitions to match any key that is not explicitly bound. For example:
`keybind = catch_all=new_window` (chaos!). 

`catch_all` can be used in combination with modifiers, so if you want to
catch any non-bound key with Ctrl held down, you can do:
`keybind = ctrl+catch_all=new_window`.

`catch_all` can also be used with trigger sequences, so you can do:
`keybind = ctrl+a>catch_all=new_window` to catch any key pressed after
`ctrl+a` that is not explicitly bound and make a new window!

And if you want to remove the catch all binding, it is like any other:
`keybind = catch_all=unbind`.
2025-12-19 15:03:38 -08:00
himura467
4c6d3f8ed2 macos: add toggle_background_opacity keybind action 2025-12-16 11:32:10 -08:00
Mitchell Hashimoto
1a117c46e0 macos: fix missing goto_window union entry 2025-12-13 14:29:09 -08:00
Max Bretschneider
b344c978d0 Added GOTO_WINDOW to actions enum 2025-12-13 13:45:45 -08:00
Max Bretschneider
1c1ef99fb1 Window switching initial 2025-12-13 13:45:44 -08:00
Mitchell Hashimoto
dc7bc3014e add apprt action to notify apprt of surface readonly state 2025-12-12 13:13:54 -08:00
Matthew Hrehirchuk
547bcd261d fix: removed apprt action for toggle_readonly 2025-12-12 07:24:22 -08:00
Matthew Hrehirchuk
12bb2f3f47 feat: add readonly surface mode 2025-12-12 07:24:22 -08:00
Mitchell Hashimoto
65cf124e2c core: change apprt action to enum value instead of a new one 2025-12-11 16:09:45 -08:00
Mitchell Hashimoto
32033c9e1a core: prompt_tab_title binding and apprt action 2025-12-11 16:03:19 -08:00
George Papadakis
625d7274bf Add close tabs on the right action 2025-12-10 20:14:27 -08:00
Mitchell Hashimoto
2ee2d000f5 apprt actions for search progress 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
b7e70ce534 apprt: end_search 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
aeaa8d4ead add start_search binding and apprt action 2025-11-26 08:50:03 -08:00
Mitchell Hashimoto
901708e8da input: write_*_file actions take an optional format
Fixes #9398
2025-10-31 09:49:59 -07:00
Mitchell Hashimoto
0f1c46e4a4 macos: support setting multiple clipboard content types 2025-10-30 14:01:58 -07:00
Mitchell Hashimoto
7d7c0bf5cd lib-vt: Wasm SGR helpers and example (#9362)
This adds some convenience functions for parsing SGR sequences
WebAssembly and adds an example demonstrating SGR parsing in the
browser.
2025-10-26 13:19:55 -07:00
Mitchell Hashimoto
a82ad89ef3 lib-vt: C API for SGR parser (#9352)
This exposes the SGR parser to the C and Wasm APIs. An example is shown
in c-vt-sgr.

Compressed example:

```c
#include <assert.h>
#include <stdio.h>
#include <ghostty/vt.h>

int main() {
  // Create parser
  GhosttySgrParser parser;
  assert(ghostty_sgr_new(NULL, &parser) == GHOSTTY_SUCCESS);

  // Parse: ESC[1;31m (bold + red foreground)
  uint16_t params[] = {1, 31};
  assert(ghostty_sgr_set_params(parser, params, NULL, 2) == GHOSTTY_SUCCESS);

  printf("Parsing: ESC[1;31m\n\n");

  // Iterate through attributes
  GhosttySgrAttribute attr;
  while (ghostty_sgr_next(parser, &attr)) {
    switch (attr.tag) {
      case GHOSTTY_SGR_ATTR_BOLD:
        printf("✓ Bold enabled\n");
        break;
      case GHOSTTY_SGR_ATTR_FG_8:
        printf("✓ Foreground color: %d (red)\n", attr.value.fg_8);
        break;
      default:
        break;
    }
  }

  ghostty_sgr_free(parser);
  return 0;
}
```

**AI disclosure:** Amp wrote most of the C headers, but I verified it
all. https://ampcode.com/threads/T-d9f145cb-e6ef-48a8-ad63-e5fc85c0d43e
2025-10-25 21:26:06 -07:00
Mitchell Hashimoto
c133fac7e7 lib-vt: wasm convenience functions and a simple example (#9309)
This adds a set of Wasm convenience functions to ease memory management.
These are all prefixed with `ghostty_wasm` and are documented as part of
the standard Doxygen docs.

I also added a very simple single-page HTML example that demonstrates
how to use the Wasm module for key encoding.

This also adds a bunch of safety checks to the C API to verify that
valid values are actually passed to the function. This is an easy to hit
bug.

**AI disclosure:** The example is AI-written with Amp. I read through
all the code and understand it but I can't claim there isn't a better
way, I'm far from a JS expert. It is simple and works currently though.
Happy to see improvements if anyone wants to contribute.
2025-10-22 14:25:52 -07:00
Mitchell Hashimoto
da7736cd44 renderer: emit scrollbar apprt event when scrollbar changes 2025-10-15 21:45:01 -07:00
Mitchell Hashimoto
bf9f025aec lib-vt: begin paste utilities exports starting with safe paste 2025-10-06 21:09:28 -07:00
Mitchell Hashimoto
725203d494 lib-vt: split header to be more consumable 2025-10-06 20:48:49 -07:00
Mitchell Hashimoto
9194d6c496 doxygen: integrate examples into documentation 2025-10-06 08:44:47 -07:00
Mitchell Hashimoto
fd0851bae7 lib-vt: update documentation with more examples 2025-10-05 14:54:58 -07:00
Mitchell Hashimoto
61fe78c1d3 lib-vt: expose key encoding as a C API 2025-10-05 14:40:20 -07:00
Jeffrey C. Ollie
07124dba64 core: add 'command finished' notifications
Fixes #8991

Uses OSC 133 esc sequences to keep track of how long commands take to
execute. If the user chooses, commands that take longer than a user
specified limit will trigger a notification. The user can choose between
a bell notification or a desktop notification.
2025-10-02 12:40:40 -05:00
Mitchell Hashimoto
cc0b7f74fd lib-vt: document allocators 2025-09-29 09:12:12 -07:00
Mitchell Hashimoto
15670a77f3 lib-vt: document main html page 2025-09-29 08:59:16 -07:00
Mitchell Hashimoto
3bc07c24aa lib-vt: OSC data extraction boilerplate
This also changes OSC strings to be null-terminated to ease lib-vt
integration. This shouldn't have any practical effect on terminal
performance, but it does lower the maximum length of OSC strings by 1
since we always reserve space for the null terminator.
2025-09-29 06:40:01 -07:00
Mitchell Hashimoto
cfe9f19454 lib-vt: expose command type enum 2025-09-28 07:21:46 -07:00
Mitchell Hashimoto
f564ffa30b lib-vt: expose ghostty_osc_end 2025-09-27 15:15:51 -07:00
Mitchell Hashimoto
6b1f4088dd lib-vt: add the C functions for command inspection 2025-09-27 15:03:38 -07:00
Mitchell Hashimoto
b3d1802c89 lib_vt: osc_next/reset 2025-09-27 13:25:56 -07:00