ENG-1352: Add open in Alacritty support#2131
Conversation
Greptile SummaryThis PR adds Alacritty as an "Open In" terminal option, including its SVG icon, a registry entry with
Confidence Score: 3/5The registry and icon additions are safe to ship, but the remote SSH handler is broken for all modern Alacritty installs and should be fixed before merging. The remote SSH launch passes src/main/core/app/service.ts — the Alacritty remote SSH launch block needs
|
| Filename | Overview |
|---|---|
| src/main/core/app/service.ts | Adds Alacritty remote SSH handler modelled on the Ghostty block, but passes -e to Alacritty which was removed in v0.13; all three launch attempts will fail on modern installations. |
| src/shared/openInApps.ts | Adds Alacritty to the app registry with correct --working-directory flag, three darwin launch strategies, win32, and linux; no issues. |
| src/shared/openInApps.test.ts | New test file verifying Alacritty registry entries and platform launch commands; assertions match the implementation correctly. |
| src/assets/images/alacritty.svg | New Alacritty SVG icon sourced from Wikimedia Commons; no code issues. |
Sequence Diagram
sequenceDiagram
participant UI as Renderer
participant SVC as AppService
participant OS as OS Process
UI->>SVC: "openApp({ app: 'alacritty', isRemote: true, sshConnectionId })"
SVC->>SVC: openInRemote()
SVC->>SVC: buildRemoteTerminalExecArgs(host, user, port, path)
alt "platform === darwin"
SVC->>OS: open -n -b org.alacritty --args -- ssh-cmd
OS-->>SVC: success / error
alt failed
SVC->>OS: open -na Alacritty --args -- ssh-cmd
OS-->>SVC: success / error
end
alt failed
SVC->>OS: alacritty -- ssh-cmd
OS-->>SVC: success / error
end
else linux / win32
SVC->>OS: alacritty -- ssh-cmd
OS-->>SVC: success / error
end
SVC-->>UI: resolve / throw
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/main/core/app/service.ts:324-345
**`-e` flag removed in Alacritty v0.13**
Alacritty removed the `-e`/`--command` option in v0.13 (late 2023). Every attempt in the array that passes `-e` before `remoteExecArgs` will fail with an "unknown option" error on any modern Alacritty installation. The correct separator is now `--`: `alacritty -- <cmd> [args…]`. For the macOS `open --args` variants, the same applies — `'--args', '-e', ...remoteExecArgs` should become `'--args', '--', ...remoteExecArgs`.
```suggestion
const attempts =
platform === 'darwin'
? [
{
file: 'open',
args: ['-n', '-b', 'org.alacritty', '--args', '--', ...remoteExecArgs],
},
{ file: 'open', args: ['-na', 'Alacritty', '--args', '--', ...remoteExecArgs] },
{ file: 'alacritty', args: ['--', ...remoteExecArgs] },
]
: [{ file: 'alacritty', args: ['--', ...remoteExecArgs] }];
```
Reviews (1): Last reviewed commit: "ENG-1352: add Alacritty open-in support" | Re-trigger Greptile
| if (appId === 'alacritty') { | ||
| const remoteExecArgs = buildRemoteTerminalExecArgs({ | ||
| host, | ||
| username, | ||
| port, | ||
| targetPath: target, | ||
| }); | ||
| const attempts = | ||
| platform === 'darwin' | ||
| ? [ | ||
| { | ||
| file: 'open', | ||
| args: ['-n', '-b', 'org.alacritty', '--args', '-e', ...remoteExecArgs], | ||
| }, | ||
| { file: 'open', args: ['-na', 'Alacritty', '--args', '-e', ...remoteExecArgs] }, | ||
| { file: 'alacritty', args: ['-e', ...remoteExecArgs] }, | ||
| ] | ||
| : [{ file: 'alacritty', args: ['-e', ...remoteExecArgs] }]; | ||
|
|
||
| await this.launchRemoteTerminal('Alacritty', attempts); | ||
| return; | ||
| } |
There was a problem hiding this comment.
-e flag removed in Alacritty v0.13
Alacritty removed the -e/--command option in v0.13 (late 2023). Every attempt in the array that passes -e before remoteExecArgs will fail with an "unknown option" error on any modern Alacritty installation. The correct separator is now --: alacritty -- <cmd> [args…]. For the macOS open --args variants, the same applies — '--args', '-e', ...remoteExecArgs should become '--args', '--', ...remoteExecArgs.
| if (appId === 'alacritty') { | |
| const remoteExecArgs = buildRemoteTerminalExecArgs({ | |
| host, | |
| username, | |
| port, | |
| targetPath: target, | |
| }); | |
| const attempts = | |
| platform === 'darwin' | |
| ? [ | |
| { | |
| file: 'open', | |
| args: ['-n', '-b', 'org.alacritty', '--args', '-e', ...remoteExecArgs], | |
| }, | |
| { file: 'open', args: ['-na', 'Alacritty', '--args', '-e', ...remoteExecArgs] }, | |
| { file: 'alacritty', args: ['-e', ...remoteExecArgs] }, | |
| ] | |
| : [{ file: 'alacritty', args: ['-e', ...remoteExecArgs] }]; | |
| await this.launchRemoteTerminal('Alacritty', attempts); | |
| return; | |
| } | |
| const attempts = | |
| platform === 'darwin' | |
| ? [ | |
| { | |
| file: 'open', | |
| args: ['-n', '-b', 'org.alacritty', '--args', '--', ...remoteExecArgs], | |
| }, | |
| { file: 'open', args: ['-na', 'Alacritty', '--args', '--', ...remoteExecArgs] }, | |
| { file: 'alacritty', args: ['--', ...remoteExecArgs] }, | |
| ] | |
| : [{ file: 'alacritty', args: ['--', ...remoteExecArgs] }]; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/main/core/app/service.ts
Line: 324-345
Comment:
**`-e` flag removed in Alacritty v0.13**
Alacritty removed the `-e`/`--command` option in v0.13 (late 2023). Every attempt in the array that passes `-e` before `remoteExecArgs` will fail with an "unknown option" error on any modern Alacritty installation. The correct separator is now `--`: `alacritty -- <cmd> [args…]`. For the macOS `open --args` variants, the same applies — `'--args', '-e', ...remoteExecArgs` should become `'--args', '--', ...remoteExecArgs`.
```suggestion
const attempts =
platform === 'darwin'
? [
{
file: 'open',
args: ['-n', '-b', 'org.alacritty', '--args', '--', ...remoteExecArgs],
},
{ file: 'open', args: ['-na', 'Alacritty', '--args', '--', ...remoteExecArgs] },
{ file: 'alacritty', args: ['--', ...remoteExecArgs] },
]
: [{ file: 'alacritty', args: ['--', ...remoteExecArgs] }];
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
-ecommand formImpact
Users can select Alacritty from Open In options when it is installed. Remote project opens also launch an SSH session in Alacritty using the existing terminal launcher flow.
Validation
pnpm run formatpnpm run lintpnpm run typecheckpnpm run test