Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Warp integration for Linux #1087

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/src/lib/shells/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export enum Shell {
Alacritty = 'Alacritty',
Kitty = 'Kitty',
LXTerminal = 'LXDE Terminal',
Warp = 'Warp',
}

export const Default = Shell.Gnome
Expand Down Expand Up @@ -64,6 +65,8 @@ function getShellPath(shell: Shell): Promise<string | null> {
return getPathIfAvailable('/usr/bin/kitty')
case Shell.LXTerminal:
return getPathIfAvailable('/usr/bin/lxterminal')
case Shell.Warp:
return getPathIfAvailable('/usr/bin/warp-terminal')
default:
return assertNever(shell, `Unknown shell: ${shell}`)
}
Expand All @@ -88,6 +91,7 @@ export async function getAvailableShells(): Promise<
alacrittyPath,
kittyPath,
lxterminalPath,
warpPath,
] = await Promise.all([
getShellPath(Shell.Gnome),
getShellPath(Shell.GnomeConsole),
Expand All @@ -104,6 +108,7 @@ export async function getAvailableShells(): Promise<
getShellPath(Shell.Alacritty),
getShellPath(Shell.Kitty),
getShellPath(Shell.LXTerminal),
getShellPath(Shell.Warp),
])

const shells: Array<FoundShell<Shell>> = []
Expand Down Expand Up @@ -167,6 +172,10 @@ export async function getAvailableShells(): Promise<
shells.push({ shell: Shell.LXTerminal, path: lxterminalPath })
}

if (warpPath) {
shells.push({ shell: Shell.Warp, path: warpPath })
}

return shells
}

Expand Down Expand Up @@ -200,6 +209,8 @@ export function launch(
return spawn(foundShell.path, ['--single-instance', '--directory', path])
case Shell.LXTerminal:
return spawn(foundShell.path, ['--working-directory=' + path])
case Shell.Warp:
return spawn(foundShell.path, [], { cwd: path })
default:
return assertNever(shell, `Unknown shell: ${shell}`)
}
Expand Down
Loading