Skip to content
Open
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
2,221 changes: 1,416 additions & 805 deletions Cargo.lock

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ keywords = ["terminal", "gpui"]

[workspace.dependencies]
anyhow = "1"
async-tungstenite = "0.34"
async-tungstenite = "0.35"
atomic-write-file = "0.3"
base64 = "0.22"
base64 = "0.23"
bitflags = "2"
camino = "1"
core-text = "=22.0.0"
Expand All @@ -40,7 +40,7 @@ futures = "0.3"
gethostname = "1.1"
hex = { version = "0.4", features = ["std"] }
home = "0.5"
itertools = "0.14"
itertools = "0.15"
libc = "0.2"
libssh-rs = "0.3.6"
log = "0.4"
Expand All @@ -53,6 +53,7 @@ polling = "3"
rand = "0.10"
regex = "1"
regex-automata = "0.4"
# Keep aligned with zeroclawlabs: libsqlite3-sys permits only one linked version.
rusqlite = { version = "0.37", features = ["bundled"] }
rust-i18n = "4.0.0"
rust-embed = "8"
Expand All @@ -77,18 +78,19 @@ thiserror = "2"
unicode-width = "0.2"
url = "2"
urlencoding = "2"
ureq = { version = "2.12", default-features = true, features = ["tls", "json"] }
ureq = { version = "3.4", features = ["json"] }
unicode-segmentation = "1.12.0"
vte = { version = "0.15", default-features = false }
windows = "0.62"
windows-sys = "0.62"
windows-sys = "0.61"

# gpui dependencies
gpui = { git = "https://github.com/zed-industries/zed" }
gpui_platform = { git = "https://github.com/zed-industries/zed" }
gpui-base = { git = "https://github.com/longbridge/gpui-component.git" }
gpui-component = { git = "https://github.com/longbridge/gpui-component.git" }
gpui-component-assets = { git = "https://github.com/longbridge/gpui-component.git" }
# GPUI Kit components pin this GPUI snapshot; upgrade these dependencies together.
# Keep the existing crate names via aliases so application imports stay stable.
gpui = { package = "gpui-pre", version = "=0.3.6" }
gpui_platform = { package = "gpui-pre-platform", version = "=0.3.6", features = ["font-kit", "runtime_shaders"] }
gpui-base = "=0.6.6"
gpui-component = "=0.6.6"
gpui-component-assets = { package = "gpui-kit-assets", version = "=0.6.6" }

# termua dependencies
alacritty_terminal = { path = "crates/alacritty_terminal" }
Expand All @@ -109,9 +111,6 @@ wezterm-surface = { git = "https://github.com/wezterm/wezterm.git" }
wezterm-term = { git = "https://github.com/wezterm/wezterm.git" }
wezterm-uds = { git = "https://github.com/wezterm/wezterm.git" }

[patch.crates-io]
gpui-component-macros = { git = "https://github.com/longbridge/gpui-component.git" }

[profile.release]
strip = true
opt-level = "z"
Expand Down
1 change: 1 addition & 0 deletions assets/icons/moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions crates/alacritty_terminal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ default = ["serde"]
serde = ["dep:serde", "bitflags/serde", "vte/serde"]

[dependencies]
base64 = "0.22.0"
base64 = "0.23"
bitflags = "2.4.1"
home = "0.5.5"
libc = "0.2"
Expand All @@ -35,7 +35,7 @@ signal-hook = "0.4.3"
[target.'cfg(windows)'.dependencies]
piper = "0.2.1"
miow = "0.6.0"
windows-sys = { version = "0.59.0", features = [
windows-sys = { version = "0.61", features = [
"Win32_System_Console",
"Win32_Foundation",
"Win32_Security",
Expand Down
6 changes: 3 additions & 3 deletions crates/alacritty_terminal/src/tty/windows/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use polling::{
os::iocp::{CompletionPacket, PollerIocpExt},
};
use windows_sys::Win32::{
Foundation::{BOOLEAN, FALSE, HANDLE},
Foundation::{FALSE, HANDLE},
System::Threading::{
GetExitCodeProcess, GetProcessId, INFINITE, RegisterWaitForSingleObject, UnregisterWait,
WT_EXECUTEINWAITTHREAD, WT_EXECUTEONLYONCE,
Expand All @@ -38,8 +38,8 @@ struct ChildExitSender {
}

/// WinAPI callback to run when child process exits.
extern "system" fn child_exit_callback(ctx: *mut c_void, timed_out: BOOLEAN) {
if timed_out != 0 {
unsafe extern "system" fn child_exit_callback(ctx: *mut c_void, timed_out: bool) {
if timed_out {
return;
}

Expand Down
13 changes: 8 additions & 5 deletions crates/gpui_dock/src/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ actions!(gpui_dock_tiles, [Undo, Redo]);
const MINIMUM_SIZE: Size<Pixels> = size(px(100.), px(100.));
const DRAG_BAR_HEIGHT: Pixels = px(30.);
const HANDLE_SIZE: Pixels = px(5.0);
// Preserve the tile defaults removed from gpui-component's shared theme.
const TILE_GRID_SIZE: Pixels = px(8.);
const TILE_RADIUS: Pixels = px(0.);

#[derive(Clone, PartialEq, Debug)]
struct TileChange {
Expand Down Expand Up @@ -383,7 +386,7 @@ impl Tiles {
let mut new_origin = self.dragging_initial_bounds.origin + delta;

// Apply magnetic snap before boundary checks
let snap_threshold = cx.theme().tile_grid_size;
let snap_threshold = TILE_GRID_SIZE;
let dragging_bounds = Bounds {
origin: new_origin,
size: self.dragging_initial_bounds.size,
Expand Down Expand Up @@ -1041,7 +1044,7 @@ impl Tiles {
// More 1px to account for the border width when 2 panels are too close
.w(item.bounds.size.width + px(1.))
.h(item.bounds.size.height + px(1.))
.rounded(cx.theme().tile_radius)
.rounded(TILE_RADIUS)
.child(h_flex().overflow_hidden().size_full().child(panel_view))
.children(self.render_resize_handles(window, cx, entity_id, &item))
.child(self.render_drag_bar(window, cx, entity_id, &item))
Expand Down Expand Up @@ -1135,8 +1138,8 @@ impl Tiles {
}

#[inline]
fn round_to_nearest_ten(value: Pixels, cx: &App) -> Pixels {
(value / cx.theme().tile_grid_size).round() * cx.theme().tile_grid_size
fn round_to_nearest_ten(value: Pixels, _cx: &App) -> Pixels {
(value / TILE_GRID_SIZE).round() * TILE_GRID_SIZE
}

#[inline]
Expand Down Expand Up @@ -1175,7 +1178,7 @@ impl Render for Tiles {

div()
.relative()
.bg(cx.theme().tiles)
.bg(cx.theme().background)
.child(
div()
.id("tiles")
Expand Down
1 change: 0 additions & 1 deletion crates/gpui_term/src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,6 @@ mod content_update_event_tests {

use super::*;

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn sync_emits_content_updated_after_backend_snapshot_is_ready(cx: &mut gpui::TestAppContext) {
cx.update(crate::init);
Expand Down
9 changes: 0 additions & 9 deletions crates/gpui_term/src/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,6 @@ mod suggestion_selection_tests {
assert_eq!(state.selected, None);
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn enter_does_not_accept_suggestion_when_unselected(cx: &mut gpui::TestAppContext) {
use std::cell::RefCell;
Expand Down Expand Up @@ -1239,7 +1238,6 @@ mod suggestion_selection_tests {
);
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn accept_suggestion_at_index_works_without_selection(cx: &mut gpui::TestAppContext) {
use std::cell::RefCell;
Expand Down Expand Up @@ -1310,7 +1308,6 @@ mod suggestion_selection_tests {
assert!(!still_open, "accept should close suggestions");
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn focus_out_closes_suggestions(cx: &mut gpui::TestAppContext) {
use std::cell::RefCell;
Expand Down Expand Up @@ -1563,7 +1560,6 @@ mod suggestion_acceptance_shell_agnostic_tests {
content
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn accept_selected_suggestion_allows_shell_prompt_decorations_after_cursor(
cx: &mut gpui::TestAppContext,
Expand Down Expand Up @@ -1624,7 +1620,6 @@ mod suggestion_acceptance_shell_agnostic_tests {
assert!(!still_open, "accept should close suggestions");
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn accept_selected_suggestion_falls_back_when_prompt_prefix_changes(
cx: &mut gpui::TestAppContext,
Expand Down Expand Up @@ -1692,7 +1687,6 @@ mod prompt_context_tests {

use super::{scrollbar::scrollbar_preview_tests::PreviewBackend, *};

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn prompt_context_snapshots_content_and_cursor_line_id(cx: &mut gpui::TestAppContext) {
cx.update(|app| {
Expand Down Expand Up @@ -1740,7 +1734,6 @@ mod ime_state_tests {

use super::{scrollbar::scrollbar_preview_tests::PreviewBackend, *};

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn marked_text_range_defaults_to_utf16_length_when_platform_does_not_supply_range(
cx: &mut gpui::TestAppContext,
Expand Down Expand Up @@ -1775,7 +1768,6 @@ mod ime_state_tests {
});
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn empty_marked_text_clears_ime_state(cx: &mut gpui::TestAppContext) {
cx.update(crate::init);
Expand Down Expand Up @@ -1993,7 +1985,6 @@ mod snippet_placeholder_key_down_tests {
}
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn typing_replaces_selected_snippet_placeholder(cx: &mut gpui::TestAppContext) {
use std::{cell::RefCell, rc::Rc};
Expand Down
1 change: 0 additions & 1 deletion crates/gpui_term/src/view/scrollbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ pub(super) mod scrollbar_preview_tests {
}
}

#[cfg_attr(target_os = "macos", ignore)]
#[gpui::test]
fn scrollbar_preview_is_not_obscured_by_footer_bar(cx: &mut gpui::TestAppContext) {
cx.update(|app| {
Expand Down
17 changes: 14 additions & 3 deletions crates/menubar/src/titlebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ impl MenubarTitleBar {
mod tests {
use std::sync::Mutex;

#[cfg(not(target_os = "macos"))]
use gpui::AppContext as _;
use gpui::{
AppContext as _, AvailableSpace, Context, InteractiveElement as _, IntoElement, Modifiers,
MouseButton, ParentElement as _, Render, Styled as _, Window, point, px, size,
AvailableSpace, Context, InteractiveElement as _, IntoElement, ParentElement as _, Render,
Styled as _, Window, point, px, size,
};
#[cfg(not(target_os = "macos"))]
use gpui_base::TextSelection;
#[cfg(not(target_os = "macos"))]
use gpui_component::{
Root,
text::{TextView, TextViewState},
Expand All @@ -94,10 +98,12 @@ mod tests {
}
}

#[cfg(not(target_os = "macos"))]
struct SelectableContentTestView {
text: gpui::Entity<TextViewState>,
}

#[cfg(not(target_os = "macos"))]
impl SelectableContentTestView {
fn new(cx: &mut Context<Self>) -> Self {
Self {
Expand All @@ -106,6 +112,7 @@ mod tests {
}
}

#[cfg(not(target_os = "macos"))]
impl Render for SelectableContentTestView {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
gpui::div()
Expand Down Expand Up @@ -163,9 +170,13 @@ mod tests {
}
}

#[cfg_attr(target_os = "macos", ignore)]
// The in-window menubar's selection-suppression handler is only installed on
// Linux/Windows; macOS uses the native menubar instead.
#[cfg(not(target_os = "macos"))]
#[gpui::test]
fn dragging_titlebar_does_not_start_text_selection(cx: &mut gpui::TestAppContext) {
use gpui::{Modifiers, MouseButton};

let _env_guard = MACOS_ENV_LOCK.lock().unwrap();

cx.update(|app| {
Expand Down
4 changes: 2 additions & 2 deletions crates/termua_zeroclaw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ license.workspace = true
anyhow.workspace = true

tokio = { version = "1.50", features = ["rt", "time", "io-util", "net", "sync", "fs"] }
zeroclaw = { package = "zeroclawlabs", version = "0.5.7", default-features = false }
zeroclaw = { package = "zeroclawlabs", version = "0.6.9", default-features = false }
serde.workspace = true
serde_json.workspace = true
url.workspace = true
ureq = { version = "2.12", default-features = true, features = ["tls", "json"] }
ureq.workspace = true
sysinfo.workspace = true
25 changes: 13 additions & 12 deletions crates/termua_zeroclaw/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,22 +301,23 @@ impl Client {
.context("API key is required to fetch models")?;

let timeout_secs = options.provider_timeout_secs.unwrap_or(30);
let agent = ureq::AgentBuilder::new()
.timeout(Duration::from_secs(timeout_secs))
.build();
let agent: ureq::Agent = ureq::Agent::config_builder()
.timeout_global(Some(Duration::from_secs(timeout_secs)))
.build()
.into();

let models_url = models_url_from_base(&api_url)?;
let mut req = agent
.get(models_url.as_str())
.set("accept", "application/json")
.set("authorization", &format!("Bearer {api_key}"));
.header("accept", "application/json")
.header("authorization", &format!("Bearer {api_key}"));

for (k, v) in options.extra_headers.iter() {
req = req.set(k, v);
req = req.header(k, v);
}

let resp = req.call().context("fetch /models")?;
let v: serde_json::Value = resp.into_json().context("parse /models json")?;
let mut resp = req.call().context("fetch /models")?;
let v: serde_json::Value = resp.body_mut().read_json().context("parse /models json")?;

fn extract_ids(arr: &[serde_json::Value]) -> Vec<String> {
let mut out = Vec::new();
Expand Down Expand Up @@ -452,10 +453,10 @@ impl Client {
let mut base = endpoint_base_url(endpoint);
base.push_str("health");

let resp = ureq::get(&base).set("accept", "application/json").call();
let resp = ureq::get(&base).header("accept", "application/json").call();
match resp {
Ok(r) => Ok(r.status() == 200),
Err(ureq::Error::Status(code, _)) => Ok(code == 200),
Err(ureq::Error::StatusCode(_)) => Ok(false),
Err(err) => Err(anyhow::anyhow!(err)),
}
}
Expand All @@ -467,7 +468,7 @@ impl Client {
base.push_str("admin/shutdown");

let resp = ureq::post(&base)
.set("accept", "application/json")
.header("accept", "application/json")
.send_json(serde_json::json!({}))
.context("POST /admin/shutdown")?;
if resp.status() != 200 {
Expand Down Expand Up @@ -499,7 +500,7 @@ impl Client {
return;
};
rt.block_on(async move {
let _ = zeroclaw::gateway::run_gateway(&host, port, config).await;
let _ = zeroclaw::gateway::run_gateway(&host, port, config, None).await;
});
})
.context("spawn zeroclaw gateway thread")?;
Expand Down
1 change: 1 addition & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Footbar:
MultiExecute: "Multi Execute"
Messages: "Messages"
Assistant: "Assistant"
ThemeToggle: "Toggle dark/light theme"
Lock: "Lock"
LockUnsupported: "Lock (unsupported)"
LockDisabled: "Lock (disabled)"
Expand Down
1 change: 1 addition & 0 deletions locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Footbar:
MultiExecute: "批量执行"
Messages: "通知"
Assistant: "助手"
ThemeToggle: "切换深色/浅色主题"
Lock: "锁屏"
LockUnsupported: "锁屏(不支持)"
LockDisabled: "锁屏(已禁用)"
Expand Down
Loading
Loading