Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -19,6 +19,9 @@ jobs:
- name: Metal toolchain (macOS; GPUI compiles shaders)
if: runner.os == 'macOS'
run: xcrun -f metal >/dev/null 2>&1 || xcodebuild -downloadComponent MetalToolchain
- name: System libraries (Linux; GPUI's X11, Wayland and font backends)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libfontconfig-dev libwayland-dev libx11-xcb-dev libxcb1-dev libxkbcommon-x11-dev libvulkan1 zlib1g-dev
- name: Build
run: cargo build --locked
- name: Install just
Expand Down
36 changes: 34 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,41 @@ jobs:
name: releases-osx
path: dist/releases

linux:
# An AppImage; Velopack updates it in place.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Install Velopack CLI
run: dotnet tool install -g vpk
- name: System libraries (GPUI's X11, Wayland and font backends)
run: sudo apt-get update && sudo apt-get install -y libfontconfig-dev libwayland-dev libx11-xcb-dev libxcb1-dev libxkbcommon-x11-dev libvulkan1 zlib1g-dev
- name: Version from tag
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Build
run: |
cargo build --release --locked
mkdir -p dist/publish
cp target/release/claudiu dist/publish/
- name: Fetch previous release (for delta updates)
continue-on-error: true
run: vpk download github --channel linux --repoUrl "${{ github.server_url }}/${{ github.repository }}" --token "${{ secrets.GITHUB_TOKEN }}"
- name: Pack
run: vpk pack --packId Claudiu --packVersion "${{ steps.ver.outputs.version }}" --packDir dist/publish --mainExe claudiu --packTitle Claudiu --icon assets/claudiu.png --channel linux --outputDir dist/releases
- uses: actions/upload-artifact@v4
with:
name: releases-linux
path: dist/releases

publish:
# The builds run in parallel; uploading from one job afterwards avoids both racing to create the release.
needs: [windows, macos]
needs: [windows, macos, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
Expand All @@ -94,6 +126,6 @@ jobs:
- name: Upload
run: |
version="${GITHUB_REF_NAME#v}"
for channel in win osx; do
for channel in win osx linux; do
vpk upload github --channel "$channel" --repoUrl "${{ github.server_url }}/${{ github.repository }}" --outputDir "releases-$channel" --merge --publish --releaseName "Claudiu $version" --tag "${{ github.ref_name }}" --token "${{ secrets.GITHUB_TOKEN }}"
done
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Claudiu

Claudiu is a native desktop app, written in Rust with [GPUI](https://gpui.rs), that runs several [Claude Code](https://code.claude.com) sessions in one window on Windows and macOS. It is a personal project with rough edges. Issues and pull requests are welcome.
Claudiu is a native desktop app, written in Rust with [GPUI](https://gpui.rs), that runs several [Claude Code](https://code.claude.com) sessions in one window on Windows, macOS and Linux. It is a personal project with rough edges. Issues and pull requests are welcome.

> **Claudiu is an independent project. It is not affiliated with, endorsed by or sponsored by Anthropic.** Claude and Claude Code are trademarks of Anthropic.

Expand All @@ -14,16 +14,23 @@ Ctrl+Shift (Cmd+Shift on macOS) plus a letter drives the app. Everything else re

## What it touches

Claudiu never deletes a transcript. It writes to Claude Code's own data only to change the settings you switch in Claudiu, as `/config` does, and to sync shared files between accounts. Nothing is uploaded and terminal contents are never logged. The only network use is GitHub: the update check (off with `"settings": { "update_url": "" }` in `state.json`) and the GitHub pane. State lives in `%LOCALAPPDATA%\m4rocks\Claudiu\data` on Windows and `~/Library/Application Support/Claudiu` on macOS, and crashes go to `crash.log` there.
Claudiu never deletes a transcript. It writes to Claude Code's own data only to change the settings you switch in Claudiu, as `/config` does, and to sync shared files between accounts. Nothing is uploaded and terminal contents are never logged. The only network use is GitHub: the update check (off with `"settings": { "update_url": "" }` in `state.json`) and the GitHub pane. State lives in `%LOCALAPPDATA%\m4rocks\Claudiu\data` on Windows, `~/Library/Application Support/Claudiu` on macOS and `~/.local/share/claudiu` on Linux, and crashes go to `crash.log` there.

## Known gaps

- macOS is lightly tested, and the build isn't notarized, so Gatekeeper complains on first launch.
- Linux is new and lightly tested. An app started from the desktop sees only the session's PATH, so tools that only your shell's startup files add (nvm, for one) aren't found.
- Quitting ends running PTYs. Sessions stay resumable, but live processes don't survive a restart.

## Development

You need stable Rust. On Windows you also need Visual Studio Build Tools (C++) and the Windows SDK. Tasks go through [just](https://just.systems); run `just` to list them.
You need stable Rust. On Windows you also need Visual Studio Build Tools (C++) and the Windows SDK. On Linux you need the headers GPUI builds against; on Debian or Ubuntu:

```sh
sudo apt install libfontconfig-dev libwayland-dev libx11-xcb-dev libxcb1-dev libxkbcommon-x11-dev libvulkan1 zlib1g-dev
```

Tasks go through [just](https://just.systems); run `just` to list them.

```sh
just run # dev build: shows stderr, never checks for updates
Expand All @@ -39,4 +46,4 @@ The repository has four parts:
- `web/` is the Astro site.
- `vendor/gpui-base/` is a patched copy of the editor crate. `Cargo.toml` says what the patch changes and when to drop it.

`CLAUDE.md` has the conventions for contributing. Releases use [Velopack](https://velopack.io) and GitHub Releases: bump `version` in `Cargo.toml`, then `git tag vX.Y.Z && git push --tags`. `scripts\package.ps1` builds a local installer.
`CLAUDE.md` has the conventions for contributing. Releases use [Velopack](https://velopack.io) and GitHub Releases: bump `version` in `Cargo.toml`, then `git tag vX.Y.Z && git push --tags`. `scripts\package.ps1` builds a local installer. The Linux release is an AppImage.
4 changes: 2 additions & 2 deletions src/github/ui/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl GithubView {
.cursor_pointer()
.hover(|s| s.bg(hsla(0x1c1c1d)))
.child(div().text_color(hsla(theme::TEXT_FAINT)).child(icon(if open { IconName::ChevronDown } else { IconName::ChevronRight }, 12.0)))
.child(div().flex_1().min_w_0().overflow_hidden().whitespace_nowrap().text_ellipsis().font_family(FONT).text_size(crate::panels::scale::px(12.0)).child(f.path.clone()))
.child(div().flex_1().min_w_0().overflow_hidden().whitespace_nowrap().text_ellipsis().font_family(monospace_font()).text_size(crate::panels::scale::px(12.0)).child(f.path.clone()))
.children((f.status != "modified").then(|| faint(f.status.clone())))
.child(div().text_size(crate::panels::scale::px(11.5)).text_color(hsla(GREEN)).child(format!("+{}", f.additions)))
.child(div().text_size(crate::panels::scale::px(11.5)).text_color(hsla(RED)).child(format!("−{}", f.deletions)))
Expand All @@ -47,7 +47,7 @@ impl GithubView {
if f.no_patch {
return div().p(px(12.0)).child(faint("No inline diff for this file (binary or too large). Open on GitHub to view it."));
}
let mut lines = div().flex().flex_col().font_family(FONT).text_size(crate::panels::scale::px(11.5)).py(px(4.0));
let mut lines = div().flex().flex_col().font_family(monospace_font()).text_size(crate::panels::scale::px(11.5)).py(px(4.0));
for l in f.lines.iter().take(if full { usize::MAX } else { SHOWN }) {
let (bg, sign) = match l.kind {
DiffKind::Add => (Some(GREEN), "+"),
Expand Down
8 changes: 4 additions & 4 deletions src/github/ui/detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl GithubView {
if let Some(pr) = &d.pr {
status = status.child(
div()
.font_family(FONT)
.font_family(monospace_font())
.text_size(crate::panels::scale::px(11.5))
.px(px(7.0))
.py(px(1.0))
Expand Down Expand Up @@ -422,7 +422,7 @@ impl GithubView {
.gap(px(8.0))
.px(px(4.0))
.child(div().text_color(hsla(theme::TEXT_FAINT)).child(icon(IconName::GitCommitHorizontal, 14.0)))
.child(div().font_family(FONT).text_size(crate::panels::scale::px(11.5)).text_color(hsla(theme::ACCENT)).child(c.short.clone()))
.child(div().font_family(monospace_font()).text_size(crate::panels::scale::px(11.5)).text_color(hsla(theme::ACCENT)).child(c.short.clone()))
.child(div().flex_1().min_w_0().overflow_hidden().whitespace_nowrap().text_ellipsis().child(c.headline.clone()))
.child(faint(format!("{} · {}", c.author, ago(c.created, t))))
}
Expand Down Expand Up @@ -474,7 +474,7 @@ impl GithubView {
}
for (k, c) in r.comments.iter().enumerate() {
let hunk: Vec<&str> = c.hunk.lines().rev().take(6).collect::<Vec<_>>().into_iter().rev().collect();
let mut code = div().flex().flex_col().font_family(FONT).text_size(crate::panels::scale::px(11.5)).bg(hsla(0x0e0e0f)).py(px(4.0)).overflow_hidden();
let mut code = div().flex().flex_col().font_family(monospace_font()).text_size(crate::panels::scale::px(11.5)).bg(hsla(0x0e0e0f)).py(px(4.0)).overflow_hidden();
for l in hunk {
let bg = if l.starts_with('+') { Some(GREEN) } else if l.starts_with('-') { Some(RED) } else { None };
code = code.child(div().px(px(10.0)).whitespace_nowrap().when_some(bg, |d, c| d.bg(hsla(c).opacity(0.14))).child(if l.is_empty() { " ".to_string() } else { l.to_string() }));
Expand All @@ -489,7 +489,7 @@ impl GithubView {
.gap(px(8.0))
.px(px(12.0))
.py(px(6.0))
.child(div().font_family(FONT).text_size(crate::panels::scale::px(11.5)).text_color(hsla(theme::TEXT_DIM)).child(format!("{}{}", c.path, c.line.map(|l| format!(":{l}")).unwrap_or_default())))
.child(div().font_family(monospace_font()).text_size(crate::panels::scale::px(11.5)).text_color(hsla(theme::TEXT_DIM)).child(format!("{}{}", c.path, c.line.map(|l| format!(":{l}")).unwrap_or_default())))
.children(c.outdated.then(|| faint("outdated"))),
)
.child(code)
Expand Down
2 changes: 1 addition & 1 deletion src/github/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use super::model::*;
use crate::panels::widgets::Trigger;
use super::view::*;
use crate::store::now;
use crate::terminal::view::FONT;
use crate::platform::monospace_font;
use crate::panels::theme::{self, hsla};
use gpui_kit::assets::IconName;
use crate::panels::widgets::{ago, avatar, button, button_disabled, button_leading, danger_button, fade_in, icon, icon_button, section_label};
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ fn open_main_window(initial: Vec<std::path::PathBuf>, cx: &mut App) -> MainWindo
}),
// The top bar owns dragging and double-click (see TitleBar::window_options).
app_owns_titlebar_drag: true,
// Linux: the top bar draws min/max/close itself instead of the window manager adding a second bar above
// it. A compositor without client-side decorations keeps its own bar. Other platforms ignore this.
window_decorations: Some(gpui::WindowDecorations::Client),
..Default::default()
},
cx,
Expand Down
3 changes: 3 additions & 0 deletions src/panels/workspace_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ impl Workspace {
// traffic lights at the left (they are hidden in fullscreen); Windows/Linux get min/max/close at the right.
let left_pad = if cfg!(target_os = "macos") && !window.is_fullscreen() { 80.0 } else { 10.0 };
TitleBar::new()
// Linux draws its own close button, which would otherwise drop the window without asking about working
// sessions or saving the layout. Going through Quit is the same path as Ctrl+Q and the OS close.
.on_close_window(|_, window, cx| window.dispatch_action(Box::new(crate::app::Quit), cx))
.h(px(theme::TOPBAR_HEIGHT))
.pl(px(left_pad))
.bg(hsla(theme::APP_BG))
Expand Down
42 changes: 42 additions & 0 deletions src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,39 @@ pub fn through_login_shell(program: String, args: Vec<String>) -> (String, Vec<S
}
}

/// The fixed-width font for terminals and code. GPUI matches family names exactly and, when one is missing, falls
/// back to a proportional UI font, which breaks a terminal's grid; so Linux uses the monospace family fontconfig
/// picks for the desktop instead of naming one that may not be installed.
pub fn monospace_font() -> &'static str {
#[cfg(target_os = "windows")]
{
"Cascadia Mono"
}
#[cfg(target_os = "macos")]
{
"Menlo"
}
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
{
static FAMILY: std::sync::OnceLock<String> = std::sync::OnceLock::new();
FAMILY.get_or_init(|| fontconfig_monospace().unwrap_or_else(|| "DejaVu Sans Mono".into()))
}
}

#[cfg(not(any(target_os = "windows", target_os = "macos")))]
fn fontconfig_monospace() -> Option<String> {
let output = Command::new("fc-match").args(["--format=%{family[0]}", "monospace"]).stderr(Stdio::null()).output().ok()?;
if !output.status.success() {
return None;
}
family_from_fc_match(&String::from_utf8_lossy(&output.stdout))
}

#[cfg(any(not(any(target_os = "windows", target_os = "macos")), test))]
fn family_from_fc_match(output: &str) -> Option<String> {
Some(output.trim()).filter(|family| !family.is_empty()).map(String::from)
}

pub fn home_dir() -> Option<PathBuf> {
directories::BaseDirs::new().map(|d| d.home_dir().to_path_buf())
}
Expand Down Expand Up @@ -152,6 +185,7 @@ fn path_between_markers(output: &str) -> Option<&str> {

/// The registry's directories first, then whatever this process had that the registry lacks (for example folders a
/// launcher added for Claudiu alone). Each directory appears once.
#[cfg(any(target_os = "windows", target_os = "macos", test))]
fn rebuilt_path(registry: &[PathBuf], current: &OsStr) -> std::ffi::OsString {
let mut dirs: Vec<PathBuf> = Vec::new();
for dir in registry.iter().cloned().chain(std::env::split_paths(current)) {
Expand Down Expand Up @@ -488,6 +522,14 @@ bye
assert_eq!(clean_path(Path::new(r"\\?\C:\x\y")), PathBuf::from(r"C:\x\y"));
}

#[test]
fn the_monospace_family_is_what_fc_match_printed() {
assert_eq!(family_from_fc_match("DejaVu Sans Mono"), Some("DejaVu Sans Mono".to_string()));
assert_eq!(family_from_fc_match(" Fira Mono\n"), Some("Fira Mono".to_string()));
assert_eq!(family_from_fc_match(""), None, "no answer keeps the default");
assert_eq!(family_from_fc_match(" \n"), None);
}

#[test]
fn env_expansion() {
unsafe { std::env::set_var("CLAUDIU_TEST_X", "val") };
Expand Down
3 changes: 1 addition & 2 deletions src/terminal/skeleton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::time::Duration;
use gpui::{Animation, AnimationExt, IntoElement, Keystroke, div, prelude::*, px};

use crate::terminal::glyphs;
use crate::terminal::view::FONT;
use crate::panels::theme;

/// The message being typed. Edits are by character; `at` is a byte offset on a character boundary.
Expand Down Expand Up @@ -444,7 +443,7 @@ pub fn overlay(draft: &Draft, elapsed: Duration, phase: &str, grid: Grid) -> imp
// Claude Code keeps its prompt at the bottom of the screen.
.justify_end()
.overflow_hidden()
.font_family(FONT)
.font_family(crate::platform::monospace_font())
.text_size(crate::panels::scale::px(14.0))
.line_height(px(lh))
.child(
Expand Down
6 changes: 1 addition & 5 deletions src/terminal/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ impl Focusable for TerminalView {
/// A row's height at the terminal's 14 px font (`font_size * 1.35`, rounded); the skeleton prompt lines up with it.
pub const LINE_H: f32 = 19.0;

#[cfg(target_os = "windows")]
pub const FONT: &str = "Cascadia Mono";
#[cfg(not(target_os = "windows"))]
pub const FONT: &str = "Menlo";

/// What to look for on Claude Code's screen to know a piece of the draft arrived.
enum Marker {
Expand Down Expand Up @@ -191,7 +187,7 @@ impl TerminalView {
handing: false,
exit_code: None,
marked: None,
font_family: FONT,
font_family: crate::platform::monospace_font(),
font_size: px(14.0),
loading: false,
handover: None,
Expand Down
2 changes: 1 addition & 1 deletion src/visual/ui/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl R {
font.style = FontStyle::Italic;
}
if ctx.mono {
font.family = crate::terminal::view::FONT.into();
font.family = crate::platform::monospace_font().into();
}
let color = hsla(ctx.color);
out.runs.push(TextRun {
Expand Down
Loading