Desktop Projects: "Open in Terminal" fails on Wayland desktops and on any checkout with an SSH remote
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
**Describe the bug**
In Desktop → Projects, "Open in Terminal" never works on this machine. Two independent
defects cause it, and a third hides both from the user.
**1. A non-HTTPS clone URL blocks a checkout that already exists on disk.**
`open_project_terminal` in `desktop/src-tauri/src/commands/project_terminal.rs`
(`main` @ `59328d5ae`) validates the clone URL before it looks for a local checkout:
```rust
pub async fn open_project_terminal(
...
) -> Result {
if let Some(clone_url) = clone_url.as_deref() {
validate_local_clone_url_for_workspace(clone_url, &state)?;
}
```
`validate_local_clone_url_for_workspace` accepts only a public
`https://github.com/owner/repo` URL or a clone URL on the active workspace relay.
`validate_clone_url` rejects anything that is not `http`/`https`:
```rust
if !matches!(parsed.scheme(), "http" | "https") {
return Err("clone URL must be http or https".into());
}
```
So a project whose clone URL is `ssh://git@github.com/owner/repo.git` — or
`git@github.com:owner/repo.git` — fails the guard, and the command returns before
`find_local_repo_dir` ever runs. Opening a terminal in a directory that already exists
locally needs no clone URL at all. The guard belongs on the clone path, not the
open-existing-checkout path.
**2. The Linux launcher only knows Debian-era X11 emulators.**
```rust
#[cfg(target_os = "linux")]
fn launch_terminal_at(path: &std::path::Path) -> Result<(), String> {
let candidates: [(&str, &[&str]); 4] = [
("x-terminal-emulator", &[]),
("gnome-terminal", &[]),
("konsole", &[]),
("xterm", &[]),
];
```
`x-terminal-emulator` is a Debian alternatives symlink. It does not exist on Arch,
Fedora, or openSUSE. A typical Wayland desktop has none of the four:
```
x-terminal-emulator ABSENT
gnome-terminal ABSENT
konsole ABSENT
xterm ABSENT
xdg-terminal-exec /usr/bin/xdg-terminal-exec
foot /usr/bin/foot
TERMINAL=xdg-terminal-exec
```
The two portable answers — the `$TERMINAL` environment variable and the freedesktop
`xdg-terminal-exec` spec — are both ignored.
**3. The frontend discards the native error.**
`desktop/src/features/projects/ui/useOpenProjectTerminal.ts` replaces whatever the
command returned with a fixed string:
```ts
const presentation = options.hasLocalCheckout
? {
title: "Couldn’t open terminal",
description: "Buzz could not open this checkout in your configured terminal.",
}
: projectCloneErrorPresentation(error, project.cloneUrls[0]);
```
"clone URL must be http or https" and "no terminal emulator found" are different
problems with different fixes. The user sees neither.
**Steps to reproduce**
1. Use a Linux desktop without `x-terminal-emulator`, `gnome-terminal`, `konsole`, or
`xterm` — for example Arch with Hyprland and `foot`.
2. Open a Buzz project backed by a local checkout whose remote is SSH.
3. Click "Open in Terminal".
4. Nothing opens. The toast says only "Buzz could not open this checkout in your
configured terminal", which is not the actual reason.
**Expected behavior**
- An existing local checkout opens in a terminal regardless of the project's clone URL
scheme.
- The launcher honours `$TERMINAL`, then `xdg-terminal-exec`, before the legacy list.
- A failure surfaces the real error text.
**Version and platform**
- Buzz version: reproduced on a local build of `822c5ab23` (0.5.18). All three code
paths are unchanged on `main` @ `59328d5ae` (0.5.20).
- OS: Arch Linux, Hyprland (Wayland), `$TERMINAL=xdg-terminal-exec`.
**Logs / additional context**
I have a working patch and can open a PR if the direction looks right. Confirmed on
this machine that `xdg-terminal-exec` passes the working directory through correctly:
the intermediate process reports cwd `/`, but the child shell lands in the repository.
Filed separately from the Projects pull request diff defects — different files,
different root cause.
Contributor guide
Research direction
Start with open_project_terminal and launch_terminal_at in desktop/src-tauri/src/commands/project_terminal.rs, then inspect useOpenProjectTerminal.ts. Trace the existing-checkout and clone paths, the Linux terminal candidates, and the native error presentation. Done means local SSH checkouts open, $TERMINAL and xdg-terminal-exec are considered, and failures show their actual reason.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust, typescript
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100