Skip to content

Add ghostty strategy#885

Open
benpickles wants to merge 1 commit intovim-test:masterfrom
benpickles:ghostty-strategy
Open

Add ghostty strategy#885
benpickles wants to merge 1 commit intovim-test:masterfrom
benpickles:ghostty-strategy

Conversation

@benpickles
Copy link
Copy Markdown

@benpickles benpickles commented Mar 11, 2026

Make sure these boxes are checked before submitting your pull request:

  • Add fixtures and spec when implementing or updating a test runner I don't see existing tests for the other AppleScript strategies...
  • Update the README accordingly
  • Update the Vim documentation in doc/test.txt

AppleScript support was added to Ghostty in version 1.3.

@codeinabox
Copy link
Copy Markdown
Collaborator

Thank you for this. Is it possible to have the script within the strategy or does it need to be a separate file?

@benpickles
Copy link
Copy Markdown
Author

No idea I'm afraid, I just copied the existing approach of calling AppleScript (which is only terminal and iterm strategies as far as I can see).


function! test#strategy#ghostty(cmd) abort
let cmd = join(['cd ' . shellescape(getcwd()), s:pretty_command(a:cmd)], '; ')
call s:execute_script('osx_ghostty', cmd)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this only work for people on macOS or would it also work on Linux?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, Ghostty is available on both macOS and Linux https://ghostty.org/docs/install/binary and it looks like Windows support is in progress.

I use macOS and MacVim. I imagine the AppleScript-driven terminal/iterm strategies specifically mention MacVim because its users likely want to retain the app workflow with a separate editor app and a separate terminal app. I suppose if you run Vim within Ghostty there'd be an existing strategy that would allow you to shell out to the terminal or you could use an embedded terminal - but I don't know about that because I've only ever used vim-test with MacVim and the terminal strategy.

So I don't know if there'd be another need for a ghostty strategy that doesn't use AppleScript, but I don't think there's anything offensive about renaming it applescript_ghostty or something like that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest renaming the script to macos_ghostty, wrapping the call in if has('mac') and updating the docs to make it clear this strategy only works on macOS

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.

2 participants