* 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>
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>
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
`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.