From eea93e3a3ab8ef1886ba6d1e85d795fe89d0733f Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Sat, 7 May 2022 10:50:19 -0400 Subject: [PATCH] feat: add LXTerminal to supported terminals on Linux (#711) Co-authored-by: Brendan Forster --- app/src/lib/shells/linux.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/lib/shells/linux.ts b/app/src/lib/shells/linux.ts index 11ec46e8ac8..d32ab6ae3d9 100644 --- a/app/src/lib/shells/linux.ts +++ b/app/src/lib/shells/linux.ts @@ -23,6 +23,7 @@ export enum Shell { XFCE = 'XFCE Terminal', Alacritty = 'Alacritty', Kitty = 'Kitty', + LXTerminal = 'LXDE Terminal', } export const Default = Shell.Gnome @@ -65,6 +66,8 @@ function getShellPath(shell: Shell): Promise { return getPathIfAvailable('/usr/bin/alacritty') case Shell.Kitty: return getPathIfAvailable('/usr/bin/kitty') + case Shell.LXTerminal: + return getPathIfAvailable('/usr/bin/lxterminal') default: return assertNever(shell, `Unknown shell: ${shell}`) } @@ -88,6 +91,7 @@ export async function getAvailableShells(): Promise< xfcePath, alacrittyPath, kittyPath, + lxterminalPath, ] = await Promise.all([ getShellPath(Shell.Gnome), getShellPath(Shell.GnomeConsole), @@ -103,6 +107,7 @@ export async function getAvailableShells(): Promise< getShellPath(Shell.XFCE), getShellPath(Shell.Alacritty), getShellPath(Shell.Kitty), + getShellPath(Shell.LXTerminal), ]) const shells: Array> = [] @@ -162,6 +167,10 @@ export async function getAvailableShells(): Promise< shells.push({ shell: Shell.Kitty, path: kittyPath }) } + if (lxterminalPath) { + shells.push({ shell: Shell.LXTerminal, path: lxterminalPath }) + } + return shells } @@ -193,6 +202,8 @@ export function launch( return spawn(foundShell.path, ['-w', path]) case Shell.Kitty: return spawn(foundShell.path, ['--single-instance', '--directory', path]) + case Shell.LXTerminal: + return spawn(foundShell.path, ['--working-directory=' + path]) default: return assertNever(shell, `Unknown shell: ${shell}`) }