Commit Graph
378 Commits
Author SHA1 Message Date
galact-byte 2cac13b35b Merge branch 'main' into fix/windows-cmd-interrupt 2026-09-19 19:41:12 +08:00
unifanandkuddev 5d473572f9 feat(terminal): support markdown links and cross-platform local file opening (#204)
* feat(terminal): support markdown links and cross-platform local file opening

Support terminal Ctrl+Click navigation for Markdown links and local paths across Windows, macOS, and Linux. Addresses https://github.com/Kuddev/pebrel/issues/203.

- Improve DEFAULT_HINT_REGEX: use [a-z] for smart-case insensitivity, ASCII word boundaries for drive letters, balanced nested parentheses in Markdown links, and exclusion of CJK punctuation.
- Release terminal lock before filesystem/network I/O when opening hints to prevent UI freezing on slow/remote drives.
- Pass pane and AnswerReader cwd to resolve relative paths, with localized warning toast when cwd is absent.
- Support generic protocol URIs and explicit OSC 8 hyperlinks without rigid whitelist blocking.
- Support Unix hostname resolution (gethostname, HOST, HOSTNAME) for file:// URIs without corrupting percent characters in raw disk paths.
- Integrate with platform::file_manager as the single authoritative file opener, with fallback to file reveal and failure visibility in both GPUI toasts and legacy shell toasts.

* fix(links): preserve hint actions and move file opening off UI threads

---------

Co-authored-by: kuddev <kuddev@users.noreply.github.com>
2026-09-19 19:32:13 +08:00
c3f79d6a0e fix(gpui): keep outline rows single-line so long headings cannot overlap (#191)
A heading label in the reader's outline wrapped once it exceeded the panel
width. The row's height is fixed during layout measurement, and the
horizontal available width of that scroll layer is not reliable there, so
the second line was painted outside its row box and landed on the next
heading's title. It only appeared with a narrow details panel and long
numbered headings.

Labels now use `truncate()`, so an outline row is always exactly one line
tall and its height no longer depends on the heading text. The full label
stays reachable through the row tooltip and the existing "copy heading"
context menu.

`Tooltip` now comes from the GPUI shell prelude, keeping third-party entry
points in the controlled list instead of importing `gpui_component` at the
call site.

`focus_tests` covers the contract: with the details panel at its minimum
width, the longest heading's row must be as tall as the shortest one's.

Co-authored-by: tataraDM <2201325624@qq.com>
Co-authored-by: Kuddev <christianmazel230@gmail.com>
2026-09-19 18:54:24 +08:00
galact 80cf48943d fix: restore Ctrl+C handling for Windows terminal children 2026-09-19 03:13:30 +08:00
kuddev 65e67bbc0f release: integrate reviewed shell selection and prepare Pebrel 1.8.2 2026-09-17 22:13:47 +08:00
kuddev bfa5d47339 test: verify notification guards and hidden Windows child processes 2026-09-17 12:31:59 +08:00
AnxForever 25cac197d5 fix(gpui): stop screen silence from toasting "turn complete"
The screen watchdog downgrades `Working -> Done` after the pane's screen has
been static for 5 ticks (it samples at 1 Hz), and that transition used to
notify unconditionally. But a static screen is not evidence that the agent
stopped: Claude Code prints nothing while it thinks, and a long command such
as a full build writes nothing for minutes. The result was a "回合完成" toast
while the task was still running.

The screen is only a fallback for when the hook never arrives. When hooks are
live, the agent CLI's own `TurnDone` is the authoritative terminal state, so
keep the screen-derived transition (the sidebar dot still updates) but stay
silent about it. Clients without hooks keep the old behaviour, where the
screen really is the only evidence.

This is the notification half of the problem. The other half is that
`active_background_tasks` never fires for Claude Code — its `Stop` payload
carries no `background_tasks` field — so the guard at the top of the
`TurnDone` arm is dead code for that CLI. Left as-is for now.
2026-09-17 12:19:36 +08:00
kuddev cfd2d64c05 Merge PR #143: hide background console children on Windows 2026-09-17 12:13:00 +08:00
kuddev 6862d44958 Merge PR #142: account for all active background tasks 2026-09-17 12:11:35 +08:00
Kuddev d61314b53e Merge branch 'main' into fix/shell-script-crlf-20260916 2026-09-17 10:12:53 +08:00
kuddev 572efd616b fix(shell): normalize embedded scripts before WSL injection 2026-09-16 20:54:19 +08:00
kuddev 326c545b32 test: exercise update cancellation independently of installer availability 2026-09-16 20:16:37 +08:00
kuddev 15c18e697c fix(ci): keep native icons within the existing Windows boundary 2026-09-16 19:11:20 +08:00
kuddev 610de74f12 feat(commands): trim builtin recipes and persist user deletions 2026-09-16 18:46:57 +08:00
kuddev 97c111f54f merge: align the reviewed SSH PR test fixture with the local fix 2026-09-16 18:21:51 +08:00
Kuddev 2d21913200 Merge branch 'main' into fix/ssh-resize 2026-09-16 18:15:30 +08:00
kuddev dfde57a130 merge: integrate SSH grid resize for local regression verification 2026-09-16 18:12:58 +08:00
Kuddev 737edbb06a test(ssh): stabilize dialog hit targets and format resize regression 2026-09-16 18:12:57 +08:00
kuddev 4ada47bb78 merge: integrate verified Windows file reveal fix 2026-09-16 18:05:36 +08:00
kuddev 1a7b0158db test(ssh): keep dialog hit targets stable during simulated clicks 2026-09-16 17:56:50 +08:00
kuddev 27668353d0 feat(settings): unify keymap search and show short choices as segments 2026-09-16 17:24:52 +08:00
kuddev 24b278a4fc feat(commands): persist groups and support drag and menu membership changes 2026-09-16 17:23:48 +08:00
kuddev 95bc190e3b fix(ssh): resolve Windows config paths and own connection-test trust prompts 2026-09-16 17:22:51 +08:00
kuddev 699ff5d216 fix(commands): give the multiline editor a stable input height 2026-09-16 17:20:49 +08:00
kuddev 0016cf4b48 fix(windows): synchronize taskbar and pinned shortcut icons 2026-09-16 17:18:41 +08:00
kuddev fb5abdc1c6 fix(tabs): preserve SSH identity and defer window-close persistence 2026-09-16 17:15:48 +08:00
kuddev 2298ee3ca8 style(search): format the worker contention assertion 2026-09-16 17:10:50 +08:00
Traveritas 8b622559d9 fix(file-tree): reveal paths with spaces in the correct folder
explorer.exe parses its command line without CommandLineToArgvW rules:
quoting the whole "/select,<path>" argument makes it truncate at the
first space and fall back to the deepest existing ancestor directory.
Pass /select,"<path>" via raw_arg so only the path is quoted.

The legacy shell hand-rolled the same argument; route it through
platform::file_manager so the construction stays in one authority.

Fixes #167
2026-09-16 15:48:26 +08:00
stota1320 c7d436967f fix(ssh): keep terminal grid in sync on resize 2026-09-16 15:15:35 +08:00
kuddev c63276fd6a fix(search): retain watch invalidations while work is deferred 2026-09-16 09:28:31 +08:00
kuddev dea3bcb0e4 fix(ci): restore portable session recovery checks 2026-09-16 08:54:37 +08:00
kuddev 86128e4309 merge: include completion isolation and scrolling controls in 1.8.1
Preserve the committed memory and scrolling work from local main together with
update recovery and the default font rollback. Resolve terminal initialization
at its new lifecycle owner and keep native WSL lookup in the platform layer.

Document the seven history limits, wheel-speed settings, allocation tradeoffs
and connection-specific completion behavior in both release-note languages.
2026-09-15 23:39:20 +08:00
kuddev a8e64baf21 chore(release): prepare 1.8.1 metadata and release contracts
Synchronize package versions and bilingual notes with verified issue references.
Allow releases without PR contributors to omit that section, with positive and
negative format coverage as requested by the maintainer.

Keep native update process operations and default-shell resolution inside the
platform boundary. Preserve transaction authority in the updater and tighten
the platform condition budget to the measured 484.
2026-09-15 23:38:21 +08:00
kuddev f8144b3af4 fix(fonts): restore the 1.7 default Maple face
Restore Maple Mono Normal NF CN and its original bundled TTF as the default
for terminal font selection and fallback. Keep the other Maple family registered
for explicit selections and align both configuration template examples.

Add a regression checking the default family, filename and exact v1.7 font
asset SHA256. This restores the previous default after the visual regression
reported in #148; screenshot conditions do not establish a renderer defect.
2026-09-15 23:21:20 +08:00
kuddev 61e18b24a3 feat(settings): add scrollback limits and wheel speed controls [skip ci] 2026-09-15 23:12:53 +08:00
kuddev 12f0ef278f fix(updater): preserve workspaces through verified installation handoff
Persist native AI recovery targets and per-pane launch contexts without treating
command submission as provider confirmation. Keep window partitions and the
active window in the durable session snapshot for immediate and scheduled updates.

Coordinate draft approval, snapshot writes, helper readiness, process exit and
installation with a committed transaction. Reverify packages and retain recovery
state on failure. Isolate acceptance installers from production integrations and
reject same-version setup that leaves the executable unchanged.

Validation: Windows GPUI suite 1552 passed; settings 55 passed; i18n 20 passed;
9 native helper scenarios; 77 installer migration checks and 41 static invariants.
Full interactive packaged upgrade acceptance remains separate.
2026-09-15 22:41:58 +08:00
kuddev a02cf48fee merge: integrate completion isolation with current main [skip ci]
Preserve the current main updates together with active SSH/WSL completion
ownership and native PowerShell predictions. Renumber the completion ADR
after the existing font ownership decision.
2026-09-15 16:25:54 +08:00
kuddev d265595163 fix(completion): isolate active connections and preserve native predictions [skip ci]
Track completion history, candidates and async directory results by the active
SSH/WSL connection, and restore the parent shell when the connection returns.
Use shared ownership rules in both UI adapters and report expanded arguments
from shell execution hooks. Preserve user PSReadLine prediction settings.

Add regression coverage for context transitions, stale results and actual
Windows ConPTY transport. Validate native SSH, WSL, local PowerShell and SSH
from PowerShell, including cross-environment negatives and native predictions.

History deletion and migration remain outside this change.
2026-09-15 16:15:37 +08:00
kuddev 036d57a25c fix(tabs): restore 1.7 status alignment and unclipped glyphs 2026-09-15 12:46:20 +08:00
kuddev d426de4ae1 fix(theme): share shorthand color parsing and guard native fixtures
Accept three-digit RGB colors through the shared settings parser. Keep
save-only assertions stable while other rendered fixtures apply themes
to the same settings file.
2026-09-15 10:51:15 +08:00
kuddev 224e39a234 test(theme): adapt reader selection fixtures to resolved themes 2026-09-15 10:29:25 +08:00
kuddev 2229de571a merge: integrate saved workspace fixes after 1.8.0
Combine custom themes, updater proxies and native resource fixes with the published release source. Preserve independent interface and CJK fonts, selection visibility, saved-session startup and all existing release checks. Remove the retired terminal-view size exception after the capability extraction brought it below the standard limit.
2026-09-15 10:06:03 +08:00
kuddev fa9219fbf1 chore: save remaining workspace integration and comment edits
Apply the resolved custom theme to connection overlays and retain the pending source and documentation comment cleanup.
2026-09-15 09:49:11 +08:00
kuddev edc79ce7f3 fix(updater): honor proxies for release checks and downloads
Resolve Windows system and environment proxies consistently for each update request, including redirects and exclusions. Support HTTP and SOCKS5 proxies and show actionable localized download failures.
2026-09-15 09:46:25 +08:00
kuddev 6275b6435a feat(theme): save and edit custom theme snapshots
Commit the theme library, preview editor, foreground picker, import and export, and shared settings integration. Preserve built-in themes and apply saved custom snapshots consistently to terminal colors, typography and window appearance.
2026-09-15 09:45:17 +08:00
kuddev 96d4cf0179 fix(windows): reclaim terminal resources and retain font owners
Persist the pending ConPTY lifetime, process snapshot and native font ownership fixes. Keep lifecycle regression tests and the Windows memory stress tool together with the ownership contracts.
2026-09-15 09:44:00 +08:00
AnxForever 70b90f1880 feat(gpui): open a folder in a chosen shell from the Explorer menu
Right-clicking a folder has always opened the configured default shell —
usually PowerShell — with no way to ask for a WSL distribution instead.

- `--shell <id>` takes the same ids the `shell` setting uses (`pwsh`, `cmd`,
  `wsl:Ubuntu`, or an imported profile's settings id) and applies to the
  first tab this process creates. It carries an id rather than a path so
  every launch re-resolves the executable.
- The id travels both startup paths: the cold start (`run_shell` →
  `WorkspaceStartup::NewTerminal`), and the resident hand-off, which is the
  common case on Windows. `tab.new`/`window.create` gained an optional
  `shell` field, so clicking the menu while Pebrel is already running adds a
  tab to the existing window instead of starting a second process.
- An explicit request never silently degrades. An unresolvable id fails
  (`invalid_shell`, or a startup error before any window opens), and a
  `wsl:<distro>` id that the registry no longer lists still launches
  `wsl.exe -d <distro>`, leaving the complaint to the distribution itself.
  The `shell` setting keeps its documented fallback to the platform default.
- The winit shell rejects a shell request instead of ignoring it, so the
  caller falls back to a cold GPUI start and still gets the requested shell.

The resolution lives in a new `workspace::shell_launch` module: `main.rs` has
to validate `--shell` before it opens a window, and none of it needs
`NebulaWorkspace` state — `workspace.rs` is also at its line budget, which
this keeps from growing (`architecture/file-budgets.txt`).

The installer registers one context-menu entry per registered WSL
distribution (`PebrelWsl<n>`, skipping `docker-desktop*`) and the uninstaller
reclaims them by key prefix plus the command line it wrote. `--shell` is
passed before `--working-directory`: a drive-root `%V` ends in `\"`, which
would swallow the rest of the line if the directory came first. Both the
string and the order are pinned by installer assertions.

Docs (runtime API schema + control API) and shell completions are updated.
2026-09-14 23:07:38 +08:00
AnxForever be5fd1eb67 fix(windows): stop console children from popping terminal windows
Pebrel is a `windows_subsystem = "windows"` process, so it has no console to
hand to a child, and Windows allocates a new one for every console program we
spawn. When the default terminal application is Windows Terminal that is not
a hidden flash — it is a whole window on screen. Measured on the test binary,
which has no console for the same reason: one full `cargo test` run popped 86
windows, and the `runtime_api` module alone popped 7.

Most spawn sites already carried `CREATE_NO_WINDOW`, but each spelled it
itself — `0x0800_0000` in some places, the named constant in others, a
private `hidden_command` in one module. Three sites had no flag at all:
`pane.exec` (`runtime_exec::configure_process_group` was a no-op on Windows),
the WSL path of drag-and-drop (`path_drop::wsl_paths`), and the `ssh -G`
probe behind the `pebrel ssh` entry point.

Route every console child through one helper, `platform::process`:

- `hidden_command` for the common case;
- `hidden_command_with` when the caller needs extra creation flags (the
  daemon's `CREATE_NEW_PROCESS_GROUP`) — `creation_flags` replaces rather
  than ORs, so the helper owns the `CREATE_NO_WINDOW` bit;
- a `CREATE_NO_WINDOW` constant for `Command` types that are not
  `std::process::Command` (the tokio proxy command). No raw literals left.

Test helpers are included: the test binary is console-less too, so its git
calls popped windows as well (7 during one `runtime_api` run, 0 after).

Deliberately left alone, and now documented as such: the interactive
`pebrel ssh <host>` session (it inherits the parent console through
`AttachConsole`), the update installer wizard, and `notepad`/`explorer`/
`open`, which exist to be visible.
2026-09-14 22:57:27 +08:00
AnxForever 2b4eadcdee fix(ai-hook): keep the turn-done notification off background work
`Stop` fires at the end of every turn, not at task completion, so the guard
that suppresses the completion toast while work is still in flight is what
keeps that notification honest. It reads `background_tasks`, but the counter
only accepted entries whose type was `subagent` — and Claude Code reports a
backgrounded Bash command as `local_bash`. The most common shape (start a
long command, turn ends, command still running) therefore counted zero: the
guard stayed off and the toast claimed the turn was done while the command
was still running.

Count every entry the field carries. It is documented as in-flight work
("Empty array when nothing is in flight"), so the filter belongs on the
status, not on the type. Idle `in_process_teammate` entries stay excluded —
they keep reporting `status: "running"` after they finish
(anthropics/claude-code#85955) — matching Claude Code's own
`status === "running" && !isIdle` predicate.

Tests: three cases pin the counting (every in-flight type, an empty array
leaving the turn done, an idle teammate not holding it open). The first one
counted zero before this change.
2026-09-14 22:54:29 +08:00
kuddev 9036df712f test(session): isolate ordinary persistence fixtures from runner privileges 2026-09-14 20:57:24 +08:00