Skip to content

Commit

Permalink
shells: add Black Box terminal (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Sep 15, 2024
1 parent 0f4254f commit 9e2a14b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/src/lib/shells/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export enum Shell {
Kitty = 'Kitty',
LXTerminal = 'LXDE Terminal',
Warp = 'Warp',
BlackBox = 'Black Box',
}

export const Default = Shell.Gnome
Expand Down Expand Up @@ -71,6 +72,8 @@ function getShellPath(shell: Shell): Promise<string | null> {
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}`)
}
Expand All @@ -96,6 +99,7 @@ export async function getAvailableShells(): Promise<
kittyPath,
lxterminalPath,
warpPath,
blackBoxPath,
] = await Promise.all([
getShellPath(Shell.Gnome),
getShellPath(Shell.GnomeConsole),
Expand All @@ -113,6 +117,7 @@ export async function getAvailableShells(): Promise<
getShellPath(Shell.Kitty),
getShellPath(Shell.LXTerminal),
getShellPath(Shell.Warp),
getShellPath(Shell.BlackBox),
])

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

if (blackBoxPath) {
shells.push({ shell: Shell.BlackBox, path: blackBoxPath })
}

return shells
}

Expand All @@ -196,6 +205,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])
Expand Down
2 changes: 2 additions & 0 deletions docs/technical/shell-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -254,6 +255,7 @@ export enum Shell {
Konsole = 'Konsole',
Xterm = 'XTerm',
Terminology = 'Terminology',
BlackBox = 'Black Box',
}
```

Expand Down

0 comments on commit 9e2a14b

Please sign in to comment.