Commit Graph

9283 Commits (facda0c3fb1310c7698fc77ba193165ef38cd58e)

Author SHA1 Message Date
Mitchell Hashimoto 6c5c5b2ec0
core: clear selection whenever preedit is changed 2025-01-11 14:06:42 -08:00
Mitchell Hashimoto 0811b1d5ac
macos: paste multiple files separated by space
https://github.com/ghostty-org/ghostty/discussions/4892#discussioncomment-11808631
2025-01-11 13:58:09 -08:00
Damien Mehala fc99c99b74
code review 2025-01-11 22:19:42 +01:00
Bryan Lee af5e423ea5
Clear selection when IME input starts 2025-01-12 01:48:48 +08:00
Bryan Lee 2409d46600
Correct IME position calculation with window padding 2025-01-12 01:15:53 +08:00
Damien Mehala 95fc1d64c8
parse ConEmu OSC9;5 2025-01-11 17:24:13 +01:00
Adam Wolf c9636598fc chore: rename config value to maximize and move startup logic to proper location 2025-01-10 23:24:00 -06:00
Adam Wolf 8102fddceb apprt/gtk: add toggle_maximize keybind and window-maximize config option 2025-01-10 22:42:41 -06:00
Mitchell Hashimoto 918ccdba5c
declare `StartupWMClass` in .desktop (#4930)
This allows the app to be pinned in the dock/task manager in several
common desktop environments.

When not set this happens when you open the pinned application: 


![image](https://github.com/user-attachments/assets/81316c9c-4cd4-4a7c-ba3e-74b9a7abc1fa)
2025-01-10 19:28:28 -08:00
Samuel 941915b862
declare `StartupWMClass` in .desktop 2025-01-10 22:26:48 -04:00
Mitchell Hashimoto 5a4aac7e09
gtk: fix crash due to accessing invalidated pointer to adwaita notebook (#4926)
#4235 introduced a crash when you closed the last tab in a window. In
`NotebookAdw.closeTab` a `defer` was added that references `self`. If
the last tab is closed we destroy the window. As part of that process
`self` becomes invalid because the window has been de-initialized. The
`defer` fires at the end of the function, referencing the invalid
pointer and causing a crash.

```
info(surface): surface closed addr=7fffe400a000
debug(gtk): window destroy

(process:1032400): Gtk-CRITICAL **: 18:40:17.674: gtk_widget_unparent: assertion 'GTK_IS_WIDGET (widget)' failed
Segmentation fault at address 0x7ffff4dad040
/home/jeff/dev/ghostty/src/apprt/gtk/notebook_adw.zig:128:19: 0x340226a in closeTab (ghostty)
        defer self.forcing_close = false;
                  ^
/home/jeff/dev/ghostty/src/apprt/gtk/notebook.zig:157:40: 0x336ca86 in closeTab (ghostty)
            .adw => |*adw| adw.closeTab(tab),
                                       ^
/home/jeff/dev/ghostty/src/apprt/gtk/Window.zig:468:27: 0x327628d in closeTab (ghostty)
    self.notebook.closeTab(tab);
                          ^
/home/jeff/dev/ghostty/src/apprt/gtk/Tab.zig:121:25: 0x336581b in remove (ghostty)
    self.window.closeTab(self);
                        ^
/home/jeff/dev/ghostty/src/apprt/gtk/Surface.zig:207:34: 0x326a213 in remove (ghostty)
            .tab_ => |t| t.remove(),
                                 ^
/home/jeff/dev/ghostty/src/apprt/gtk/Surface.zig:722:30: 0x31e3a3a in close (ghostty)
        self.container.remove();
                             ^
/home/jeff/dev/ghostty/src/Surface.zig:733:26: 0x31e1dc4 in close (ghostty)
    self.rt_surface.close(self.needsConfirmQuit());
                         ^
/home/jeff/dev/ghostty/src/Surface.zig:925:23: 0x31e143e in handleMessage (ghostty)
            self.close();
                      ^
/home/jeff/dev/ghostty/src/App.zig:486:34: 0x31e2d05 in surfaceMessage (ghostty)
        try surface.handleMessage(msg);
                                 ^
/home/jeff/dev/ghostty/src/App.zig:252:62: 0x31e3005 in drainMailbox (ghostty)
            .surface_message => |msg| try self.surfaceMessage(msg.surface, msg.message),
                                                             ^
/home/jeff/dev/ghostty/src/App.zig:138:26: 0x31e378e in tick (ghostty)
    try self.drainMailbox(rt_app);
                         ^
/home/jeff/dev/ghostty/src/apprt/gtk/App.zig:1279:31: 0x31e3e42 in run (ghostty)
        try self.core_app.tick(self);
                              ^
/home/jeff/dev/ghostty/src/main_ghostty.zig:112:24: 0x31e52f4 in main (ghostty)
    try app_runtime.run();
                       ^
/nix/store/h6lccra69nr23676qq32h9qn1fba24v1-zig-0.13.0/lib/std/start.zig:524:37: 0x31e5e0e in main (ghostty)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x7ffff682a1fb in ??? (libc.so.6)
Unwind information for `libc.so.6:0x7ffff682a1fb` was not available, trace may be incomplete

fish: Job 2, './zig-out/bin/ghostty --config-…' terminated by signal SIGABRT (Abort)
```
2025-01-10 17:31:24 -08:00
Jeffrey C. Ollie 0a26321e9d
gtk: add some comments about closing the last tab invaldating self pointer 2025-01-10 19:19:11 -06:00
Jeffrey C. Ollie 16233b16e7
gtk: fix crash due to accessing invalidated pointer to adwaita notebook 2025-01-10 19:12:08 -06:00
Mitchell Hashimoto da558f2678
fix(gtk): add close confirmation for tabs (#4235)
On the discord this bit of feedback came up from
[here](https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blob;f=misc/terminfo.src;h=ccd4c32099cf740d331eeaa3955f48f177435878;hb=a28a11d84d969cfdc876e158deae7870e8948a24#l8323)
```
8323 # - ghostty has tabs (imitating gnome-terminal); when closing a tab with a
8324 #   running process (e.g., a hung vttest), ghostty does not prompt about the 
8325 #   process to be killed.
```

This PR adds confirmation to the places where tabs are closed directly 

Fixes: https://github.com/ghostty-org/ghostty/issues/4234
2025-01-10 15:45:10 -08:00
Mitchell Hashimoto 00137c4189
apprt/gtk: adw tab view close confirmation 2025-01-10 15:32:32 -08:00
Leigh Oliver 8c1ad59de7 remove unnecessary struct 2025-01-10 15:05:11 -08:00
Leigh Oliver b7b5b9bbf5 fix(gtk): add close confirmation for tabs 2025-01-10 15:05:11 -08:00
Mitchell Hashimoto 126c0505e2
fix: ensure terminal windows don't part from parent window when toggling visibility (#4789)
As of version 1.0.1 (macOS build) when running the toggle visibility
action a window with tabs is made into multiple windows.

This PR ensures terminal tabs are reconstructed and correctly placed
into its parent window.

# Demo


https://github.com/user-attachments/assets/44f14bca-15a1-4717-ba0a-44f0767feec3


FYI: I will create another PR to ensure the right tab is focused after
the main window is restored.

Solves #4329
2025-01-10 14:52:33 -08:00
Mitchell Hashimoto 200aee9acf
macos: rework toggle_visibility to better match iTerm2
Two major changes:

1. Hiding uses `NSApp.hide` which hides all windows, preserves tabs, and
   yields focus to the next app.

2. Unhiding manually tracks and brings forward only the windows we hid.
   Proper focus should be retained.
2025-01-10 14:40:02 -08:00
Alexandre Antonio Juca 61a78efa83 chore: revert on TerminalManager changes 2025-01-10 14:16:47 -08:00
Alexandre Antonio Juca 3a5aecc216 fix: hide windows without calling orderOut API 2025-01-10 14:16:47 -08:00
Alexandre Antonio Juca 4dd9fe5cfd fix: ensure terminal tabs are reconstructed in main window after toggling visibility 2025-01-10 14:16:47 -08:00
Mitchell Hashimoto d3de3448cc
gtk: add config option to disable GTK OpenGL debug logging (#4662)
The only change from default should be that when running a ReleaseFast
binary you won't get OpenGL debugging.
2025-01-10 14:01:13 -08:00
Jeffrey C. Ollie 96e427cd6a
gtk: default to opengl debugging only on debug builds 2025-01-10 15:48:20 -06:00
Mitchell Hashimoto 8e52c6d12b
Reduce ghost emoji flash in title bar (#4804)
Fixes #4799

This PR attempts to reduce the flash caused by the ghost emoji in the
title bar when opening new windows.

## Changes:

- Initialize `SurfaceView.title` with empty string instead of ghost
emoji

- Simplify title computation logic in `TerminalView`

- Adding a 500ms fallback timer for "👻"

	- Canceling timer if title is set

## Current Status:

While these changes reduce the initial ghost emoji flash, there's still
a brief moment where a folder emoji appears alone in the title bar when
opening a new window. This suggests there might be a race condition or
timing issue with how the title is being set and updated.


https://github.com/user-attachments/assets/3688c9f3-1727-4379-b04d-0bd6ac105728

Would appreciate feedback on the remaining flash issue and suggestions
for further improvements.
2025-01-10 13:46:45 -08:00
Mitchell Hashimoto b783e12b93
ci: required checks must be named separately (#4919) 2025-01-10 13:45:00 -08:00
Mitchell Hashimoto f5add68100
ci: required checks must be named separately 2025-01-10 13:31:28 -08:00
Mitchell Hashimoto 4af44c5460
ci: avoid "successful failure" of status check job by inspecting needs (#4918)
Thanks to @ryanec for this tip.
2025-01-10 13:29:50 -08:00
Mitchell Hashimoto 6237377a59
ci: avoid "successful failure" of status check job by inspecting needs
Thanks to @ryanec for this tip.
2025-01-10 13:28:21 -08:00
Jeffrey C. Ollie cd638588c4
gtk: better method for setting GDK env vars 2025-01-10 15:21:24 -06:00
Jeffrey C. Ollie 06a57842af
gtk: add config option to control GSK_RENDERER env var 2025-01-10 15:21:24 -06:00
Jeffrey C. Ollie 13e96c7ec8
gtk: add config option to disable GTK OpenGL debug logging 2025-01-10 15:21:21 -06:00
Mitchell Hashimoto c4ece2a141
GTK: refactor headerbar into separate Adwaita & GTK structs (#4850)
There's one behavioral change here. Before this patch, if
`gtk-titlebar=false` we _never_ created a headerbar. This explicitly
contradicted the comments in the source, and the documentation for
`gtk-titlebar` imply that if a window starts out without a titlebar it
can be brought back later with the `toggle_window_decorations` keybind
action.

After this patch, a headerbar is always created, but if
`gtk-titlebar=false` or `window-decoration=false` it's immediately
hidden.

I'm not sure how this interacts with the current SSD/CSD detection that
seems to happen when running Ghostty on non-Gnome DEs so it'll be
important to get #4724 merged (plus any follow ups) to enable more
explicit control of SSD/CSD.
2025-01-10 13:14:39 -08:00
Mitchell Hashimoto 96b3db0b8c
docs: update copy-on-select documentation (#4909)
As per discussion in
https://github.com/ghostty-org/ghostty/discussions/4898, this updates
the docs for `copy-on-select` to correct the middle-click paste behavior
change as per https://github.com/ghostty-org/ghostty/pull/4733. I also
opted to remove the multiple "if supported by OS/ for supported systems"
statements since it's supported everywhere now, AFAIK.
2025-01-10 13:13:12 -08:00
Mitchell Hashimoto e475560af0
vim: update configuration to include theme files (#4893)
Extends vim validation and file type detection to theme files

cc @gpanders @beaumccartney (as you were involved on the previous vim
PR)
2025-01-10 13:12:25 -08:00
Mitchell Hashimoto 61a6e670eb
ci: add required checks jobs (#4916)
This is a hack to make it easier for our GitHub branching rules to
require a single check to pass before merging. This lets us describe the
required checks in code rather than via the GH UI.
2025-01-10 13:12:00 -08:00
Mitchell Hashimoto 2fb0d99f00
ci: add required checks jobs
This is a hack to make it easier for our GitHub branching rules to
require a single check to pass before merging. This lets us describe the
required checks in code rather than via the GH UI.
2025-01-10 12:57:41 -08:00
Mitchell Hashimoto 8b8c7ecf1d
gtk: unify Wayland and X11 platforms, implement background blur for KDE X11 (#4723)
Part of #4626. Please let me know if the architecture looks alright —
I'm fairly convinced that I'm being unorthodox here.
2025-01-10 12:21:03 -08:00
Mitchell Hashimoto d26c114b5d
apprt/gtk: make sure noop winproto never initializes 2025-01-10 12:10:59 -08:00
Jeffrey C. Ollie 010f4d167d
GTK: refactor headerbar into separate Adwaita & GTK structs 2025-01-10 13:46:29 -06:00
Mitchell Hashimoto 799f5b8239
Fix wayland-scanner/protocols packaging dependency (#4910)
By updating zig-wayland:
https://codeberg.org/ifreund/zig-wayland/issues/67
2025-01-10 10:10:42 -08:00
Mitchell Hashimoto 6e411d60f2
Fix wayland-scanner/protocols packaging dependency
By updating zig-wayland:
https://codeberg.org/ifreund/zig-wayland/issues/67
2025-01-10 09:57:29 -08:00
Mitchell Hashimoto 2f81c360bd
ci: typos 2025-01-10 09:42:41 -08:00
Mitchell Hashimoto be0370cb0e
ci: test gtk-wayland in the GTK matrix 2025-01-10 09:41:14 -08:00
Mitchell Hashimoto ed81b62ec2
apprt/gtk: winproto
Rename "protocol" to "winproto".
2025-01-10 09:39:34 -08:00
Onno Siemens 19cfd99439 docs: update copy-on-select documentation 2025-01-10 18:11:57 +01:00
Anund c03828e032 vim: work with theme config files 2025-01-11 02:45:47 +11:00
Leah Amelia Chen 405a897230 gtk(x11): implement background blur for KDE/KWin on X11 2025-01-09 14:57:02 -08:00
Leah Amelia Chen 03fee2ac33 gtk: unify Wayland and X11 platforms 2025-01-09 14:57:02 -08:00
Mitchell Hashimoto 6ef757a8f8
Revert "termio/exec: fix SIGPIPE crash when reader exits early"
This reverts commit 3e24e96af5.
2025-01-09 12:43:41 -08:00