From d8caf42f41e6e522d0ae22711ff6a08e60f1e37c Mon Sep 17 00:00:00 2001 From: Adil Hanney Date: Sun, 15 Sep 2024 23:53:23 +0100 Subject: [PATCH] shells: add Black Box terminal (#1126) --- app/src/lib/shells/linux.ts | 10 ++++++++++ docs/technical/shell-integration.md | 2 ++ 2 files changed, 12 insertions(+) diff --git a/app/src/lib/shells/linux.ts b/app/src/lib/shells/linux.ts index 5800dd1f2f5..af5953e332b 100644 --- a/app/src/lib/shells/linux.ts +++ b/app/src/lib/shells/linux.ts @@ -27,6 +27,7 @@ export enum Shell { Kitty = 'Kitty', LXTerminal = 'LXDE Terminal', Warp = 'Warp', + BlackBox = 'Black Box', } export const Default = Shell.Gnome @@ -73,6 +74,8 @@ function getShellPath(shell: Shell): Promise { return getPathIfAvailable('/usr/bin/lxterminal') case Shell.Warp: return getPathIfAvailable('/usr/bin/warp-terminal') + case Shell.BlackBox: + return getPathIfAvailable('/usr/bin/blackbox-terminal') default: return assertNever(shell, `Unknown shell: ${shell}`) } @@ -98,6 +101,7 @@ export async function getAvailableShells(): Promise< kittyPath, lxterminalPath, warpPath, + blackBoxPath, ] = await Promise.all([ getShellPath(Shell.Gnome), getShellPath(Shell.GnomeConsole), @@ -115,6 +119,7 @@ export async function getAvailableShells(): Promise< getShellPath(Shell.Kitty), getShellPath(Shell.LXTerminal), getShellPath(Shell.Warp), + getShellPath(Shell.BlackBox), ]) const shells: Array> = [] @@ -182,6 +187,10 @@ export async function getAvailableShells(): Promise< shells.push({ shell: Shell.Warp, path: warpPath }) } + if (blackBoxPath) { + shells.push({ shell: Shell.BlackBox, path: blackBoxPath }) + } + return shells } @@ -198,6 +207,7 @@ export function launch( case Shell.Terminator: case Shell.XFCE: case Shell.Alacritty: + case Shell.BlackBox: return spawn(foundShell.path, ['--working-directory', path]) case Shell.Urxvt: return spawn(foundShell.path, ['-cd', path]) diff --git a/docs/technical/shell-integration.md b/docs/technical/shell-integration.md index 14c6c161600..a7d13b3a745 100644 --- a/docs/technical/shell-integration.md +++ b/docs/technical/shell-integration.md @@ -241,6 +241,7 @@ These shells are currently supported: - [Konsole](https://konsole.kde.org/) - [XTerm](http://invisible-island.net/xterm/) - [Terminology](https://www.enlightenment.org/docs/apps/terminology.md) + - [Black Box](https://gitlab.gnome.org/raggesilver/blackbox) These are defined in an enum at the top of the file: @@ -254,6 +255,7 @@ export enum Shell { Konsole = 'Konsole', Xterm = 'XTerm', Terminology = 'Terminology', + BlackBox = 'Black Box', } ```