Skip to content

Conversation

@yasuf
Copy link
Contributor

@yasuf yasuf commented Dec 30, 2025

Description

Addresses #1844

I tried an approach trying to copy what's in macos/Sources/Features/Command Palette/CommandPalette.swift in regards to the key handlers, in this version I used event.keyCode to handle keystrokes. I think it's possible to do it with the same approach asi n CommandPalette but I was just running into bugs when attempting that.

There is one small-ish bug that if you open the popup and leave the current tab with the popup still open, when you come back to it you still see the tab switcher and I think it should disappear, it doesn't affect the UI/UX in a major way but I definitely think it needs to be fixed, I can thinker with either:

  1. Fixing that bug
  2. Copying the patterns we use in CommandPalette.swift for key handlers.

Happy to address any feedback, I want these code changes to be up to par with the codebase's standards.

AI Disclaimer: I used Opus 4.5 to generate the solution and I manually typed in all code changes, tried a few other approaches and removed unnecessary features that were generated by the prompt.

If you want to play around simply checkout this branch, run the project and press CMD + P on MacOS, this was implemented only for MacOS at the moment, we'd still need to mimic this functionality in GTK.
Also you can press CMD + P multiple times and you should see the selector move 1 option down.

ghostty_mru_popup.mov

@yasuf yasuf requested review from a team as code owners December 30, 2025 02:38
mitchellh and others added 27 commits December 29, 2025 20:42
When paste_from_clipboard is triggered but the clipboard contains no
text (e.g., an image), send the raw Ctrl+V keypress to the terminal
instead of silently returning. This allows applications to handle
their own clipboard reading (e.g., via wl-paste for images on Wayland).
Make clipboardRequest return bool to indicate whether the action could
be performed. For paste requests, synchronously check if the clipboard
contains text formats before starting the async read.

This allows 'performable:paste_from_clipboard' keybinds to pass through
when the clipboard contains non-text content (e.g., images), enabling
terminal applications to handle their own clipboard reading.

Changes:
- Surface.startClipboardRequest now returns bool
- paste_from_clipboard/paste_from_selection actions return the result
- GTK apprt checks clipboard formats synchronously before async read
- Embedded apprt always returns true (can't check synchronously)
- All other call sites discard the return value with _
End the currently active key sequence, if any, and flush the
keys up to this point to the terminal, excluding the key that
triggered this action.

For example: `ctrl+w>escape=end_key_sequence` would encode
`ctrl+w` to the terminal and exit the key sequence.

Normally, an invalid sequence will reset the key sequence and
flush all data including the invalid key. This action allows
you to flush only the prior keys, which is useful when you want
to bind something like a control key (`ctrl+w`) but not send
additional inputs.
As far as I understand ghostty integrates with systemd already nowadays,
and manages its own scopes/cgroups for tabs.  As such, explicitly moving
launching ghostty into a separate systemd scope from nautilus no longer
seems necessary.
@yasuf yasuf requested review from a team as code owners December 30, 2025 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.