A `wt list` custom column that converts a `vars.*` or `git.branch.*`
value to a number — e.g. `{% if (git.branch.ahead | default(0) | int) >
0 %}` — failed config validation with `invalid float literal`, which
aborts `wt list` (the picker drops custom columns with a warning). The
template renders fine against real values; the failure came only from
the validation trial render, which answered every `vars.*` /
`git.branch.*` key with the string `"PLACEHOLDER"`.
The placeholder is now `"1"`: runtime values are strings and often
numeric (counts, ports), so `| int` / `| float` succeed, and string
filters accept it as before. Misspelled filters and syntax errors are
still rejected. The row-identity variables (`branch`, `worktree_path`,
`worktree_name`) keep their old placeholder.
Found via the stacked-branch columns shared in #1983, whose README lists
"filters like `| int` break all of `wt list`" as a limitation. The
extended `test_validate_list_column_template` fails without the change;
reproduced and verified end-to-end with a `--config-set` column against
a branch whose `branch.<name>.baseahead` is set.
Refs #1983
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`.worktreeinclude` now selects by git's own gitignore rules, including
paths inside a wholly ignored directory that an include line names, as
Claude Code does. `git ls-files --directory` lists such a directory as
one entry, so `.cache/claude-code-types/` under an ignored `.cache/`
matched nothing, and `copy-ignored` and `promote` skipped it. Claude
Code's own `.worktreeinclude` copy reaches it, and a team trialling the
Claude Code plugin lost that cache in every new worktree
(Rikmorn/sidekick#287).
Git now does all the matching. Discovery runs `git ls-files -o -i
--directory` once with the standard exclude sources and, when
`.worktreeinclude` exists, again with that file as the only source. An
entry is selected where the two listings overlap, taking the deeper path
of each pair where one holds the other. Inside a directory git lists
whole, only lines that name a path (a slash before the end, past any
leading `/` or `**/`) select, as found by a third listing of those lines
plus the negations. A name matched at any depth (`.env`, `types/`)
selects only outside such directories. Claude Code, which defines the
file, agrees on path-naming lines; it differs in opening a directory
from a line's text and then applying every line inside, so for
`packages/*/.cache/types/` plus `.env` it also copies
`packages/foo/node_modules/pkg/.env`. The `.worktreeinclude` parse error
goes away, since git takes any line as a pattern. So:
- A pattern naming a path inside an ignored directory (`.cache/types/`)
selects it, and its siblings stay behind.
- A pattern that matches at any depth (`.env`) selects the root `.env`
and any `.env` git lists on its own, but never a package's `.env` from
`node_modules/`.
- A negation can't re-include a path inside a selected directory.
- An include line naming a partly ignored directory (`build/` with only
`build/*.o` ignored) selects only its ignored files.
The cost is that each include listing walks every untracked directory:
0.33 s over 124k ignored files with a warm cache, against 0.03 s for the
standard listing. Without `.worktreeinclude`, discovery runs one listing
as before.
Reaching inside ignored directories needed boundaries that
whole-directory entries had made unnecessary:
- Built-in VCS and tool-state directories now exclude everything inside
them too, so `promote` no longer moves `.jj/repo`.
- `promote` refuses a destination that resolves outside its worktree
through a symlinked directory, and `copy-ignored` checks before creating
parent directories. The containment error now says "write" rather than
"copy".
The Claude Code page now says that hook-made worktrees ignore
`worktree.baseRef`, since the hook input carries the worktree's name and
no base.
Left alone, and older than this change: copying or promoting into a
destination where another worktree is checked out inside an ignored
directory writes into that worktree, with or without `.worktreeinclude`.
> _This was written by Claude Code on behalf of max-sixty_
`run_hook`, `run_alias`, and `handle_alias_dry_run` each return
`anyhow::Result` but encoded the forwarded positional args with
`serde_json::to_string(..).expect(..)`. AGENTS.md asks Result-returning
functions to use `?` or explicit errors rather than `expect`, so these
now use `.context("Failed to encode forwarded args")?` like the
surrounding code.
Serializing a `Vec<String>` can't fail in practice, so there's no
user-visible change and no regression test; the `step_alias` and
`user_hooks` integration tests pass locally.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
The `wt list` docs never explained the shortened counts, so a value like
`↑3C` or `+∞` could only be decoded by reading
[`format_overflow`](https://github.com/max-sixty/worktrunk/blob/a6cbc2947852261ac22540c4016901bd2f885847/src/commands/list/render.rs#L72-L91).
This adds one paragraph under **Columns** in `wt list --help` and the
generated docs: `C` is hundreds and `K` thousands, both rounded down,
`∞` means 10,000 or more, line counts stay exact up to 999 and commit
counts up to 99, shortened values are drawn brighter, and
`--format=json` carries the exact counts.
The paragraph describes current behavior, so it needs only a one-line
edit if the column widths or the `C` notation change. The docs sync test
passes and the two `wt list --help` snapshots are refreshed.
Refs #4769 — automated triage. The issue's open questions (a third digit
place for commit counts to drop `C`, and giving the count columns
priority on narrow terminals) are rendering decisions this PR leaves
alone.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
When the system config (e.g. `/etc/xdg/worktrunk/config.toml`) contains
a deprecated setting, every command printed the generic hint `To see
details, run wt config show; to apply updates, run wt config update`.
Neither command acts on the system config: `wt config update` only
checks the user and project files and answers "No deprecated settings
found", and `wt config show` renders no deprecation details for the
system section. So the hint led nowhere.
The system config now gets its own hint:
```
▲ System config: [select] is deprecated in favor of [switch.picker]
↳ wt config update leaves the system config unchanged; to apply updates, edit /etc/xdg/worktrunk/config.toml
```
The generic hint is shown at most once per process. Previously a
system-config deprecation could use it up before the user config was
checked. Now the system hint has its own path, so a user-config
deprecation in the same run still prints the `wt config update` hint.
The path reaches users through `UserConfig::load_with_warnings`, which
runs `check_and_migrate` on the system file with inline warnings on.
The new `test_system_config_deprecation_hint_points_at_the_file` failed
before the fix: stderr contained `run wt config update`. It covers both
the system-only case and the case where both files are deprecated.
The same file also had stale doc comments, now corrected:
- `migrate_content_doc` and `apply_rules` said the template-variable
rename is a cosmetic, update-only rule. It is a structural rule applied
on every load.
- `check_and_migrate` said `emit_inline_warnings = false` is for
commands other than `config show`. In fact `wt config show` and `wt
config update` are the callers that pass `false`.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Three test assertions could not fail, and two comments described code
that has since changed. This PR fixes all five. There are no behavior
changes. The picker unit tests and clippy pass locally.
**Assertions that could not fail**
- `render_preview_tabs_compacts_when_narrow`
(`src/commands/picker/items.rs`) checked that the compact tab bar drops
the "HEAD" label. No tab is labeled "HEAD" since tab 3 became
"committed", so the check always passed. It now checks "committed".
- `upstream_diff_diverged` accepted either `feat.txt` or `upstream.txt`.
For a branch that has diverged from its upstream,
`compute_upstream_diff_preview` diffs merge-base..head only. The test
now requires `feat.txt` and rejects `upstream.txt`, so a regression that
shows the upstream side would fail it.
- `test_list_progressive_vs_buffered_identical_data`
(`tests/integration_tests/list.rs`) compared `--progressive
--format=json` against `--no-progressive --format=json`.
`RenderTarget::detect` sends `OutputFormat::Json` down the JSON path
whatever `--progressive` says (its unit tests in `progressive.rs` pin
that), so both runs took the same code path. The test is removed rather
than rewritten. A meaningful progressive/buffered comparison needs a
TTY, which `list_snapshots::command` doesn't provide.
**Stale comments**
- The `PickerRow` doc paragraph ("Wrapper to implement SkimItem…") had
moved above `push_pr_search_tokens`, so rustdoc opened that function
with `PickerRow`'s description. It is back on `PickerRow`.
- The header of `benches/prune.rs` said removals run serially under the
write side of a scan lock. They run on a worker pool alongside the scan
(see the module spec in `src/commands/step/prune.rs` and
`removal_needs_write`). Only `--foreground` and current-worktree
removals serialize, and the bench's live variant uses neither, so the
old comment would mislead anyone reading the `prune-remove` timings.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`GitRemoteUrl::azure_organization` / `azure_project` read the org and
project from fixed positions in the remote path. Three valid Azure
DevOps remote forms broke that, so `wt list --format json` reported a
wrong `repo.forge.project` and `url`, and the `az` CI lookup got the
same wrong project (or, for the legacy SSH host, the org `vs-ssh`):
| Remote | Before | After |
|---|---|---|
|
`https://myorg.visualstudio.com/DefaultCollection/My%20Project/_git/my-repo`
| project `DefaultCollection` | project `My%20Project` |
| `myorg@vs-ssh.visualstudio.com:v3/myorg/My%20Project/my-repo` | host
`vs-ssh.visualstudio.com`, owner `vs-ssh`, project `v3` | host
`myorg.visualstudio.com`, owner `myorg`, project `My%20Project` |
| `https://dev.azure.com/myorg/_git/my-repo` | project `_git`, url
`…/myorg/_git/_git/my-repo` | project `my-repo`, url
`…/myorg/my-repo/_git/my-repo` |
A new private `azure_coordinates` resolves `(web host, org, project)`
for every shape. It strips a leading `DefaultCollection` on
`*.visualstudio.com`, reads `v3/{org}/{project}` on both SSH hosts, and
falls back to the repo name when the project segment is omitted (the
project's default repo shares its name). The two accessors, `web_url`,
`repo_info`, the PR-checkout org detection, and the CI-status context
all go through it. The CI-status path and the PR path now take the host
from the new `azure_web_host` rather than the raw remote host, so the
legacy SSH host maps to `{org}.visualstudio.com`.
`repo_info_from_remote_azure_devops_collection_legacy_ssh_and_default_repo`
covers the reporter's three remotes plus the `visualstudio.com` short
forms. Before the change, the issue's repro gave the wrong values in the
table; after it, a local build gives the expected ones. Existing Azure
unit and integration tests pass.
`project` and `name` still keep the URL's percent-encoding
(`My%20Project`), as the issue notes. This PR leaves that unchanged.
Closes#4763 — automated triage
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
This PR fixes comments and tests that no longer match the code. None of
it changes behavior. The nightly survey found them.
- **`PrEntry::status` is now a plain `PrStatus`
(`src/commands/picker/prs.rs`).** Both forge parsers always set it
(`parse_github_prs`, `parse_gitlab_mrs`), so the `unwrap_or` fallback in
`display_status` and the "no status" branch in `render_grid_row` could
never run. The field's doc now says the status feeds both the CI column
and the row's PR slot. Previously it said a missing status "keeps its
`#N` in the title", but rows don't render titles anymore. A comment in
`gitlab_mr_status` said the status "feeds only the CI column", but
`display_status` overlays the entry's title and body onto it, and that
combined status fills the row's PR slot. Without a CI column, rows still
show the dim `#N` reference as before.
- **`command_approval.rs` docs.** The module and `approve_hooks` docs
listed `wt remove`, `wt merge` and `wt switch --create` as the commands
it gates. `approve_hooks` is now reached only from `pre-switch` in
`switch.rs` and, through `approve_or_skip`, the pre-commit hooks of `wt
step commit` / `wt step squash`. The mutating commands approve through
`HookPlan::approve` / `ApprovedHookPlan`, as AGENTS.md requires. The
docs now say this.
- **`step_tether.rs` test doc.** It explained removal detection as
kqueue/inotify events (`NOTE_DELETE`, `IN_MOVE_SELF`). The module spec
for `src/commands/step/tether.rs` says detection is a `symlink_metadata`
poll that registers no watcher.
- **`custom.rs`.** `handle_custom_command` returns `Result` but used
`expect` on clap's guarantee. It now uses `.context(...)?`, following
AGENTS.md's error-handling rule. A test comment named two paths, "alias
outside a repository" and "alias skipped as non-UTF-8", that no longer
reach the unrecognized-subcommand error (`alias.rs` now reports both
itself). The invariant the comment describes still holds, so the wording
is now general.
- **`git_error_display.rs`.** The second half of
`multiline_error_helpers_normalize_line_endings` ran a `normalize`
closure defined in the test itself, so it passed whatever `main.rs` did.
That half is removed. The snapshot half stays, and the test is renamed
to `multiline_error_renders_in_gutter`.
`cargo clippy --all-targets` is clean. The picker, custom-subcommand,
error-display and tether tests pass locally.
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`wt list --format=json` (schema 1) and `wt list statusline
--format=json` reported the **local** branch name in `remote.branch`. So
a local `feature` tracking `origin/other-name` serialized `"branch":
"feature"`, even though the field is documented as the remote branch
name. Schema 2's `upstream.branch` already reports `other-name` for the
same row, so the two schemas disagreed.
[`upstream_to_json`](https://github.com/max-sixty/worktrunk/blob/e864cb9ef685701baad487a5a63c3c2c541b490f/src/commands/list/json_output.rs#L436-L448)
has a comment saying `UpstreamStatus` only stores the remote name. That
stopped being true once the field began carrying the upstream's short
name (`upstream_short`, set in `compute_upstream`). The fix reads
`ActiveUpstream::branch`, which is the same value schema 2 uses. It
falls back to the local name only when the upstream short name is
unknown, so output for rows without one doesn't change.
A new unit test (`test_upstream_to_json_reports_tracked_branch_name`)
fails on `main` with `left: "feature"`, `right: "other-name"` and passes
with the fix. The existing `list` and `statusline` integration tests
pass unchanged, because none of them track a remote branch under a
different name.
Found by the nightly survey.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Removes `Repository::default_branch_sha`, which has no production caller
left. The picker's branch-diff preview now keys its cache through
`Repository::branch_diff_spec` (the upstream-aware comparison base), and
the log preview's comment at
[`items.rs`](https://github.com/max-sixty/worktrunk/blob/2085f470917f60c36911dd587c0aa10bc2244de0/src/commands/picker/items.rs#L1790-L1800)
explains why it must not use an inventory snapshot. The only remaining
uses were the accessor's own three unit tests and three picker cache
tests. AGENTS.md keeps test helpers out of library code, and the
compiler doesn't flag the accessor because it is `pub` in the lib crate.
The three picker tests (`branch_diff_cache_*`) now take the cache key
from `branch_diff_spec(...).cache_sha`, the same value
`compute_branch_diff_preview` reads and writes. That ties them to the
real key rather than to "local `main`'s SHA", which only coincides with
it when the default branch has no upstream. The comment that named the
accessor now points at the `local_branches` snapshot contract it was
restating.
No behavior change, so there is no regression test. `cargo test
branch_diff_cache` (3 passed), `cargo test --lib branches`, `cargo
clippy --all-targets`, and `cargo fmt --check` all pass locally.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Corrects comments and config that no longer match the code. There are no
behavior changes. The lint change makes the `no-direct-cmd-output` hook
cover five source files it used to skip.
- **`run_pipeline.rs`**: the docs gave the hook log name as
`{branch}-{source}-{hook_type}-{name}.log`, but `HookLog::path` nests
directories (`{branch}/{source}/{hook_type}/{name}.log`). They also
cited a `shell_escape=true` flag that doesn't exist; escaping is
`ShellEscapeMode::Posix`. The serial test hatch fires on any value of
`WORKTRUNK_TEST_SERIAL_CONCURRENT`, not just `1`. The module spec now
covers the teardown that kills already-spawned children when a setup or
expansion error hits partway through a concurrent group.
- **`collect/tasks.rs`**: the `compute_is_ancestor` doc read "Uses
target (target)" and said the counts are measured against
`default_branch`. They are measured against `comparison_base`, the
upstream-aware tip.
- **`ci_status/gitea.rs`**: the comment claimed the PR list call had
"identical page semantics" to GitHub's. GitHub and GitLab filter by head
branch on the server; Gitea's list endpoint can't, so the match happens
client-side over the first 20 open PRs. The comment now says so (the
functional gap is filed separately). A test doc that cited
`ci_platform.rs:186`, a line number that has since drifted, now names
`branch_owner_repo`.
- **`cli/hook.rs` test and `run_hook` doc**: `pre-create`/`post-create`
are silent aliases, not deprecated ones (see `HOOK_TYPE_NAMES` and
`HookType`). Every post-* hook defaults to background, not just
post-start and post-switch.
- **`.config/clawpatch/features/feat_custom_signal_handling.json`**:
this still described the retired model, in which wt forwarded signals to
child process groups, and a `WorktrunkError::ChildProcessExited { signal
}` field that no longer exists. It now follows `src/signal_forwarder.rs`
and AGENTS.md: wt's own receipt of the signal is the evidence, and loops
propagate `WorktrunkError::Interrupted`. `signal_forwarder.rs` is now
listed in its context files.
- **`.pre-commit-config.yaml`, `.typos.toml`**: removed the `vendor/`
excludes, since that directory went away with the vendored skim-tuikit.
Also removed the `no-direct-cmd-output` excludes for
`src/config/{test,expansion,mod}.rs`, `src/config/user/tests.rs` and
`src/styling/mod.rs`. None of those files calls `.output()` any more, so
the excludes only hid a new direct call there.
Documentation-only, so there is no regression test. `cargo fmt --check`,
`cargo clippy --all-targets`, `cargo doc --document-private-items` with
`-D warnings`, and the edited pre-commit hooks run with `--all-files`
all pass locally.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`wt list` labelled its ahead/behind and branch-diff columns `main↕` and
`main…±` in every repository, so a repo whose default branch is `master`
or `develop` saw a header naming a branch it doesn't have (#4727).
Following the discussion there, the headers now use the symbols
worktrunk already gives these refs:
| Column | Before | After |
|--------|--------|-------|
| `working-diff` | `HEAD±` | `@±` |
| `ahead-behind` | `main↕` | `^↕` |
| `branch-diff` | `main…±` | `^…±` |
`^` is the default-branch shortcut `wt switch ^` accepts, and `@` is
both Git's and `wt switch`'s name for the current HEAD. The `## Columns`
section of the list docs now explains this in place of the sentence that
defended the fixed `main` label.
No column changes width. Each one is sized by its pre-allocated values
(`+999 -999`, `↑99 ↓99`), which were already wider than the old headers,
so the only layout change is where the shorter header is centred. Config
keys (`[list] columns`) and JSON output don't change.
The change itself is the three strings in `ColumnKind::header`. The rest
is regenerated snapshots and doc mirrors, plus comments and test
fixtures that quoted the old labels. One picker test,
`test_arrow_toward_row_ignores_the_column_header`, relied on the header
containing `main`; it now checks the same header exclusion with
`Remote`, which appears only in the header row.
The demo GIF snapshots under `docs/demos/snapshots/` still show the old
headers. They come from the demo build (`docs/demos/build`), which needs
VHS and isn't run here.
Locally, the list, picker, help and docs-sync tests pass, along with
clippy and fmt. Some `config_show`/`configure_shell` tests and a few
socket and signing tests fail in this sandbox, and they fail the same
way on `main`.
Refs #4727. The issue's other points are still open: how `C`/`K`/`∞`
overflow values are shown and documented.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`wt list`'s Summary column printed the first line of the configured
`[commit.generation]` command's output without escaping. #4605 made the
Message column run commit subjects through `escape_controls` before
truncating, but the Summary column was left out. So an ESC, BEL or CR in
the LLM's reply, such as an OSC 52 clipboard sequence echoed from a diff
it was asked to summarize, went straight to the terminal and also threw
off the width math that keeps columns aligned. The path is
`compute_summary_generate` → `generate_summary_core` →
`execute_llm_command`, which only trims the output, then `render_cell`.
This PR escapes the summary in the Summary arm of `render_cell`, as the
Message arm already does. JSON output still carries the raw text,
matching #4605.
`test_summary_column_rendering` gets a fourth case: a summary containing
an OSC 52 sequence now renders as visible `\u{1b}…\u{7}` escapes.
Without the fix, that case fails.
The picker's Summary preview tab renders the full generated summary
through its own path, and this PR doesn't change it.
Found during the nightly survey by reading the code, not from a user
report.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
This PR fixes four comments that no longer match the code. It changes no
behavior and needs no tests.
- **`src/output/concurrent.rs` module doc:** it said "every admitted
child runs to completion", but `drain_children` kills and reaps admitted
children when setting up or reading their output pipes fails. The doc
now names that exception.
- **`src/commands/list/render.rs` Upstream cell:** the comment cited
`Divergence::Special`, which doesn't exist. The in-sync case is
`Divergence::InSync`, which `Divergence::from_counts_with_remote`
returns.
- **`src/logging.rs` `init` doc:** step 3 said all four layers are gated
on `LogSink::is_active()`. Only the three file layers have a sink. The
stderr layer is filtered by verbosity and `RUST_LOG` alone. A leftover
"(unchanged)" in step 1 is also gone.
- **`src/logging.rs` `wt_trace_fields_visit_records_every_type` doc:**
it said the test covers `_` arms in `record_u64` and `record_str`.
`record_u64` is an `if` with no `_` arm, and the `_` arm it does
exercise is in `record_string`.
Found during the nightly survey.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
The orphan fsmonitor sweep that runs after `wt remove` and `wt merge`
(`run_internal_sweep` → `reap_orphan_fsmonitor_daemons` →
`classify_orphans`) treated any daemon as a class-2 orphan when its
git-dir sat under the repo's git-common-dir but wasn't a live worktree's
git-dir. Submodule git-dirs also live under the common dir, at
`.git/modules/<name>`, and `git worktree list` never reports them. So
with `core.fsmonitor=true` set globally, every sweep sent SIGTERM and
then SIGKILL to the daemons serving live submodules. That breaks the
module's own rule that a daemon serving a live checkout is never reaped.
Git respawns the daemon on the next command, so the damage is a lost
cache, not lost data.
This PR limits class 2 to the git-dirs this repo's own worktrees use:
the common dir itself, and `<common-dir>/worktrees/<name>`. Everything
else nested in the common dir is spared, the same way daemons for other
repositories already are.
`classifies_each_orphan_class_and_spares_others` now also has a
submodule daemon and a daemon for a submodule's linked worktree. Under
the old `starts_with` check, both would have been selected. Locally, the
fsmonitor unit tests and clippy pass. The one other failure,
`start_fsmonitor_daemon_skips_fork_when_daemon_answers`, also fails on
`main` here, because this sandbox blocks `AF_UNIX` sockets.
Found during the nightly survey by reading the code, not from a user
report.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`wt switch https://host/owner/repo/pull/N` asked `gh api` with no
`--hostname`, so the lookup went to gh's default host. An Enterprise URL
then 404'd when the git remote was github.com, even though gh was logged
in on the URL's host.
When `forge.hostname` is unset, the `/pull/N` URL's host is now passed
as `--hostname` if `gh auth token` succeeds for it. `pr:N` still follows
the remote, and the 404 hint is unchanged.
Checked with the new switch cases (logged in and not), the existing
enterprise-remote regression, the URL-host unit test, `cargo test
--doc`, and `cargo clippy --all-targets --all-features -- -D warnings`.
Refs #4709
Several doc comments describe code that no longer exists. This PR
changes comments only; nothing a user sees changes.
- **`src/commands/picker/pr_pane.rs`** still describes two PR pane
renderers. It says the `--prs` pane passes the list width to
`description()`, and that helpers keep styling consistent "between the
two panes". `render_pr_pane_body` in `items.rs` is now the only
renderer, and it always receives the live preview width. The
`VALUE_COLUMN` rationale also named `branch`/`author` (6) plus a 3-space
gap. The `comments` label (8 cells) plus a 1-space gap is what sets the
column at 9.
- **`src/commands/list/model/state.rs`** called `MainState`'s arrows
"horizontal" and "single-stroke", and the Remote column's
"double-stroke". They are solid vertical (`↑ ↓ ↕`) and dashed (`⇡ ⇣ ⇅`).
Its `IntegrationReason` list left out `SameCommit` and `PatchIdMatch`,
so the doc now points to the enum instead of copying the list. A garbled
test comment is also fixed. The same stale arrow wording, and a
Main-state symbol list missing `–` and `∅`, is corrected in
`StatusSymbols`'s doc in `status_symbols.rs`.
There is no regression test because nothing executable changed. `cargo
fmt --check` and `cargo clippy` pass locally.
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`gh api` doesn't take its host from the repository. Without `--hostname`
it uses gh's default host, which is github.com once more than one host
is logged in. `fetch_pr_info` passed `--hostname` only when
`forge.hostname` was set, so on a GitHub Enterprise remote `wt switch
pr:N` and `wt switch <PR URL>` asked github.com for the PR and got a
404. With no `forge.hostname`, the lookup now passes the GitHub remote's
host as `--hostname` if `gh auth token --hostname <host>` succeeds (a
local check, no network; `choose_pr_forge` already uses the same check).
An SSH alias such as `github-personal` has no gh login, so it still goes
to gh's default host. That keeps the #1790 fix in place, the one #1826
made by removing host detection. A configured `forge.hostname` still
takes priority. github.com remotes skip the check, so they behave as
before.
`test_switch_pr_enterprise_remote_passes_hostname` uses an
`https://github.example.com/...` remote and a mock `gh`. When `gh` is
logged in to that host, the test expects `--hostname github.example.com`
on the `api` call; it failed before this change and passes now. When
`gh` isn't logged in to it, the test expects no `--hostname` flag. The
existing `pr` integration tests pass.
Not changed here: the issue's second suggestion, a 404 hint that names
`forge.hostname`. That case still applies when `gh` has no login for the
Enterprise host. Whether to add that output is up to a maintainer. A PR
URL's own host is also not used yet. In the reported setup the remote's
host matches the URL's, so this change fixes that case.
Refs #4709 — automated triage
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
After two quick `alt-r` refreshes in the `wt switch` picker, a
superseded refresh whose skeleton lands last could overwrite the layout
that `alt-x` uses, so a later `alt-x` rendered its `/ branch` row on the
old column grid. `provide_layout` wrote the session-shared `layout_slot`
unconditionally. `on_skeleton` already guards the other session-shared
writes (`shared_items` and the shortcut table) with
`spawn_gen.is_current()`. This change applies the same check inside the
lock and updates the module summary, which still described three sinks.
`superseded_skeleton_leaves_shared_state_alone` now also checks that a
live spawn publishes its layout and that a superseded one leaves the
slot empty. The new assertion fails without the guard.
The nightly sweep (run
[41980394445](https://github.com/max-sixty/worktrunk/actions/runs/41980394445))
prepared this fix, but its PR was refused twice because the bot had
reached its creation allowance (#4706). The daily run review opened it
from the pushed branch without changes.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`wt step tether` returned success even when the command it supervised
failed, which hid a failed dev server or other supervised task from
scripts and hook logs. It now passes the command's exit status through
when the command exits on its own. It still sweeps the process group
first, and it uses the same child-status error as the other command
runners. Two cases are not reported as a failure of the command:
- **Ctrl-C** exits silently as interrupted, by SIGINT. Cancellation is
checked before the child status, as in `src/commands/custom.rs`.
- **Worktree removal** is tether's normal teardown, and it exits 0.
To make these distinctions, tether waits with `forward_to_children` plus
`wait_shared_child` instead of `ForegroundSignals::wait`. The latter
classifies any child that dies from SIGTERM as foreground cancellation,
so tether's own teardown SIGTERM surfaced as an interruption (exit 143).
Cancellation now counts only signals that `wt` itself received.
Verification: the `step_tether` integration tests cover all three
outcomes. `sh -c 'exit 7'` exits 7. Removing the worktree exits 0.
Ctrl-C exits by SIGINT with empty stderr. All five pass locally, and
before the wait change the removal and Ctrl-C assertions failed with
exit 143. The `child.wait()` I/O-error arm is uncovered, which the
maintainer accepted.
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
## Problem
The URL health check only probed `127.0.0.1`. A dev server bound only to
`::1` — Vite's default `localhost` on macOS — is reachable but shown as
inactive.
## Fix
Probe both loopback families (`127.0.0.1` and `::1`) for the port parsed
by `parse_port_from_url`, using the matching socket domain. Any success
counts as active. This is a local default assumption; the check never
resolves DNS or contacts a remote host.
`parse_port_from_url` is unchanged — no host parsing, IPv6 literals,
userinfo, or scheme-less handling.
## Tests
Added a unit test that binds `127.0.0.1` and `[::1]` listeners and
asserts the URL status is active for each, exercising both socket-domain
branches.
Co-authored-by: gua <schromelon@gmail.com>
Codex 0.164+ ties plugin hook approval to a fingerprint of every file in
the plugin directory. The `worktrunk` plugin keeps the skills mirror and
docs next to its four marker hooks, so almost every release made Codex
ask users to approve hooks that hadn't changed (#4654). This PR moves
those hooks into a second plugin, `worktrunk-markers`. It holds only its
manifest and copies of the `wt.sh`/`wt.cmd` shims, so its fingerprint
changes only when the hooks or shims change. `wt config plugins codex
install` adds both plugins, and `uninstall` removes both.
The design follows the live test max-sixty posted in #4654 on Codex
0.166.0. A skill or README change re-prompted the combined plugin but
not a hooks-only one. That test also listed four requirements, and this
PR covers each one:
- **Existing installs.** When an existing user's `worktrunk` plugin
updates, its hooks go away silently. The installer adds the markers
plugin, and the Codex section of the agent-integration docs now names
`codex plugin add worktrunk-markers@worktrunk` for older installs.
- **No Claude hooks warning.** The `worktrunk` Codex manifest keeps
`"hooks": {"hooks": {}}`, so Codex does not read Claude's
`hooks/hooks.json` and warn.
- **Real shim files.** The shims are real copies, not symlinks. The new
`test_codex_markers_shims_match` checks that they match
`plugins/worktrunk/hooks/` byte for byte, that the directory holds only
those three files, and that the manifest has no `version`. Neither
manifest has a `version` today, and no release step edits `plugin.json`.
- **Uninstall.** `uninstall` removes the markers plugin first. `codex
plugin remove` already exits 0 for a plugin that isn't installed, so
older single-plugin installs uninstall cleanly.
Verification: the Codex plugin, layout, help and docs-sync tests pass
locally, with snapshots updated for the new install and uninstall
output. In the sandbox, the full `pre-merge` gate stopped on `cargo fmt`
(fixed in this commit) and on test failures that come from the sandbox
itself: blocked Unix sockets, a `0644` signing key, and a nushell
autoload file left in the shared home.
`test_config_show_codex_available` fails the same way on `main` here.
Two things are unverified. I haven't run a real Codex session against
this branch. I also haven't checked that running `wt config plugins
codex install` again succeeds when the marketplace is already
registered, which is why the upgrade note in the docs names the direct
`codex plugin add` command.
Closes#4654
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
`wt remove --force` now saves a worktree's uncommitted changes before
discarding them, using the same `refs/wt-backup/<branch>` ref and reflog
that the squash backup in `wt merge` / `wt step squash` already uses.
The output then prints the backup and a recovery command:
```
▲ Discarding uncommitted changes (--force):
?? devbox.lock
↳ Backup created @ refs/wt-backup/feature-untracked (690353c)
↳ To recover in a new worktree, run wt switch --create --base 690353c… --no-hooks recovery/690353c
```
Closes#4544.
## What gets saved
- Staged, unstaged, and untracked files go into the snapshot, which is
what `git add -A` would stage. The snapshot is built through a
`TempIndex`, so the real index and the stash list are left alone.
- Ignored files, such as build output, are not saved. For submodules,
only the checked-out commit is recorded; uncommitted changes inside a
submodule are not saved.
- The backup commit's parent is the worktree's `HEAD`, so the branch tip
also stays reachable after `-D` deletes the branch. On an unborn branch
the commit has no parent.
- The backup is taken only when `--force` actually discards something. A
clean `--force` removal creates no ref.
## Decisions for review
- **Always on, no flag.** This follows the issue thread: a flag would
grow the CLI, and always saving means `-f` loses nothing you can't get
back.
- **A failed backup refuses the removal.** The error is `Failed to back
up uncommitted changes; worktree not removed`, followed by git's own
error, and the "Discarding uncommitted changes" warning is printed only
after the backup succeeds. That follows the data-safety guidance in
AGENTS.md. It means `wt remove -f` now refuses a worktree that `git add
-A` can't snapshot, such as one holding an unreadable non-ignored file
or an untracked nested repo with no commits. A worktree whose `git
status` fails (for example, a corrupt index) still has no backup and is
removed as before (#4347). The alternative is to warn and continue.
- **Cost.** Untracked files that aren't ignored are written as blobs. A
large unignored artifact makes the removal slower and grows the object
store until the reflog entry expires. Nothing prunes `refs/wt-backup/`
today, and this PR doesn't change that.
## Code
`create_safety_backup` and the new `create_removal_backup`
(`src/git/repository/working_tree.rs`) share a `record_backup` helper
for the `commit-tree` / `update-ref` step. The helper looks up the
branch name without the cache, and falls back to `symbolic-ref` so an
unborn branch is still named. The removal side lives in
`stage_worktree_removal` (`src/git/remove.rs`). That function runs right
before the worktree is renamed into trash, so it covers `wt remove`, `wt
merge --remove`, and the foreground path.
## Tests
- `test_remove_force_with_untracked_files` now checks that the backup
ref holds the untracked file's content, that its parent is the removed
branch tip, and that an ignored file is excluded.
- A new unit test covers the unborn-branch case.
- `test_remove_force_refuses_when_backup_fails` checks that an untracked
nested repo with no commits leaves the worktree in place, and that no
discard warning is printed.
- The four `remove_force_with_*` snapshots and the `wt remove --help`
snapshot gain the new lines. The docs (`wt remove` help, FAQ) mention
the backup.
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
`wt switch` now handles a fork PR or MR whose branch name is already
used locally on GitLab and Azure DevOps, matching the existing GitHub
and Gitea behavior. GitLab uses the source project's namespace as a
prefix, including nested groups; Azure DevOps uses the fork repository
name. The prefixed branch tracks the PR or MR ref and remains
fetch-only, so it cannot push to the fork.
The change also updates the `wt switch` help and its generated
documentation to describe the shared behavior. Integration tests cover
GitLab conflicts with and without existing tracking, Azure DevOps
conflicts, and the no-conflict Azure path. The prefixed-name unit tests,
docs sync test, and help snapshots pass locally.
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
A rejected `WORKTRUNK_*` env override now warns and falls back in every
command, the same way it already did in `wt list` and other tolerant
loads. Before this change, commands that load config through
`UserConfig::load()` treated it as fatal. These are `wt switch`, `wt
merge`, `wt remove`, `wt for-each`, and the `wt step` commands. Each
printed `▲ Ignoring env var overrides: …` during the startup prewarm,
then exited 1 with `✗ Failed to load config` for the same variable. The
two paths shouldn't disagree, so the tolerant behavior now applies to
all of them.
`load_with_cause` now skips `LoadError::Env`. The rejected setting falls
back to the file layers or its default, and other valid overrides still
apply. User-file parse errors, `--config-set` failures, and validation
failures stay fatal for these commands.
In practice, a mistyped override such as
`WORKTRUNK__MERGE__REMOVE=flase` or
`WORKTRUNK__REMOVE__DELETE_BRANCH=nope` no longer stops `wt merge` or
`wt remove`. The command warns once and uses the file or default value
instead.
Verification: with `WORKTRUNK__LIST__BRANCHES=not-a-bool`, `wt step eval
'{{ branch }}'` prints the single startup warning and outputs `main`
(exit 0). `test_eval_skips_invalid_env_override` pins this and replaces
the test that pinned the old exit 1. The `LoadError` docstrings are
updated to match: since #4348, `LoadError::Env` is emitted once per
rejected setting, and strict loading no longer treats it as fatal. The
public docs no longer describe this case (#4412 removed that sentence),
so no doc change is needed.
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Adds one sentence to `wt remove --help`, after the examples that remove
worktrees by name: it points readers who want to choose interactively to
`Alt-x` in the [`wt switch`
picker](https://worktrunk.dev/switch/#interactive-picker). This follows
the maintainer's request in #4635. Bare `wt remove` still removes the
current worktree.
The generated docs page, the skill reference mirrors, and the
`help_remove_long` snapshot were regenerated. `test_docs_are_in_sync`
and the help snapshot tests pass locally.
Closes#4635
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
A branch deleted outside `wt` (for example with `git branch -D`) leaves
its `worktrunk.state.<branch>.marker` key in git config. A later `wt
switch --create` with the same name then showed the old 🤖/💬. Now `wt
switch --create` clears that branch's marker once `git worktree add -b`
succeeds. #4684 already clears the marker on every `wt` deletion path.
This is the follow-up the maintainer asked for when closing #4685.
- The deletion helper from #4684 moves to
`Repository::clear_branch_marker`, and both call sites use it. It is
still best effort: a failed unset is logged at debug level, and only
marker JSON is removed, so a `vars` entry named `marker` that shares the
key is left alone.
- Only `--create` clears the marker. Switching to an existing branch
keeps its marker, and so does a DWIM checkout from a remote branch or a
PR/MR ref.
- A branch deleted and recreated with plain `git` still keeps its marker
until `wt config state marker clear`. The marker help, its generated
docs, and the help snapshot now say so.
`test_switch_create_clears_stale_marker` sets a marker on a branch name
that has no branch and on an existing branch. It then runs `wt switch
--create` for the first and plain `wt switch` for the second. It fails
without the change, because the stale marker survives, and passes with
it. The existing `deletion_*` unit tests pass on the moved helper.
Refs #4683
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
When the PowerShell temporary directory contains wildcard characters
such as `temp[1]`, `wt switch` can finish without changing the parent
shell's directory. The directive file is written, but the wrapper treats
its path as a wildcard during lookup and cleanup, leaving the file
behind.
Use `-LiteralPath` for all four directive-file operations. Add a
regression that checks both the directory change and removal of the
temporary file, and refresh the generated PowerShell snapshot.
Validation: all 4 PowerShell integration tests pass with all features
enabled, including the new regression. The shell-generation snapshot
test, pre-commit checks (including clippy), doctests and rustdoc also
pass. The original template reproduced the failure on Windows PowerShell
5; the corrected template switches directories and leaves no directive
file on both Windows PowerShell 5 and PowerShell 7.6.9.
The full `hook pre-merge --yes` gate did not pass on this Windows host:
4,693 passed, 74 failed, 40 skipped. Failures include
configuration/statusline snapshots, switch tests and the performance
helper CLI; those failures and snapshots are outside this change and
were not accepted or modified.
`wt config alias show` now displays project aliases with retired
template variables rewritten, matching what the alias actually runs.
Previously a project alias written as `code {{ repo_root }}` showed `{{
repo_root }}`, while execution (via `ProjectConfig::load`) ran the
migrated `{{ repo_path }}` — and user aliases, loaded through
`UserConfig::load`, already showed migrated text, so the two sources
disagreed in one listing.
The cause was `load_project_aliases_silent` parsing `.config/wt.toml`
with a bare `toml::from_str`, on the stated premise that the `aliases`
table has no deprecated forms. The first `DEPRECATION_RULES` row
(`migrate_template_vars_doc`) rewrites retired variables in every string
value, aliases included. The fix runs the file through the same silent
`migrate_content` that `wt config show` and the user-config loader use
before deserializing, and corrects that docstring. The same listing
feeds the `Aliases:` section of `wt --help`, which shows names only, so
only `show` changes visibly.
`test_config_alias_show_migrates_retired_template_vars` configures a
project alias with `{{ repo_root }}` and a user alias with `{{ worktree
}}`; before the fix its snapshot showed `repo_root` for the project
entry, now both show their replacements.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`truncate_visible` summed per-`char` widths, so a VS16 emoji
presentation sequence such as `♻️` (`U+267B U+FE0F`) measured 1 + 0 = 1
cell, while the terminal and the rest of the layout
(`UnicodeWidthStr::width`) count it as 2. A truncated Message cell
starting with one came out one cell wider than its column, which wraps
the row in `wt list | cat` and throws off the progressive renderer's
cursor math. The loop now walks grapheme clusters and measures each with
the string width, so the kept prefix agrees with every other width
measure and a cut can no longer split a base character from its
selector.
`unicode-segmentation` 1.12 was already in `Cargo.lock` transitively;
this adds it as a direct dependency.
The new assertions in `test_truncate_visible` fail on the old loop (`"♻️
refactor:…"`, 13 cells for a 12-cell budget) and pass now. Running the
issue's repro at `COLUMNS=100` against the fixed build, both Message
cells (`✨ feat: ad…` and `♻️ refactor…`) are 12 cells.
Closes#4681 — automated triage
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`git::remote_ref::github::tests::test_fork_remote_url_formats` ran the
real `gh config get git_protocol --host …` from the test runner's PATH,
and on Windows CI that subprocess has twice hung past nextest's 180s
limit (#4577, #4672) while every other test passed. The test only
checked the URL shape, accepting either protocol, so it never needed
`gh`. URL formatting now lives in a pure `host_remote_url(host, owner,
repo, ssh)` helper in `src/git/remote_ref/mod.rs`. Its unit test pins
both the SSH and HTTPS forms and spawns nothing. The GitLab test had the
same structure with `glab`, so it moves to the shared helper too.
`fork_remote_url` behaves the same for both forges. The protocol query
is still exercised end to end by the mock-CLI integration tests in
`tests/integration_tests/switch.rs`, which answer `config get
git_protocol` with `ssh` and assert the `--host` argument for GitHub and
GitLab.
This change does not explain why `gh` stalled on the Windows runner;
neither timeout log shows anything from inside the subprocess. It
removes the test's dependency on the runner's `gh`, which was the only
thing exposing the stall.
Closes#4672 — automated triage
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Two statusline tasks can request the same ahead/behind SHA pair
concurrently when local `main` trails `origin/main`. Each previously
missed the persistent cache and launched its own `git rev-list --count`.
A per-repository, per-pair in-memory cache now holds the first
computation while the other caller waits; the persistent cache still
serves later processes.
The new statusline regression test reproduced two matching `rev-list`
calls before the change and passes with at most one after it. `cargo
test --lib test_ahead_behind_reads_cache`, the focused integration test,
and `cargo fmt --check` pass.
Closes#4662 — automated triage
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
`wt remove --delete-branch` already overrides `[remove] delete-branch =
false`, but the flag was hidden from help. This makes the override
visible in help and the generated remove guide, and makes the `-D`
conflict error point to it when the conflict comes from config. An
explicit `--no-delete-branch` conflict now names that flag directly.
The new help test failed before the change and passes now. The existing
merged-branch override test and a new unmerged `--delete-branch -D` test
pass, as do all 192 removal integration tests and the docs sync test.
The local docs build could not run: Astro requires Node >=22.23.4 and
this runner has 22.23.3.
Closes#4614 — automated triage
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Claude Code marker hooks now write through the repository already
discovered by the hook process. This removes the nested `wt config state
marker` invocation and its repeat repository discovery and worktree
listing. Marker events remain silent and keep their existing best-effort
behavior; the regression test failed on the old Stop hook's stderr
output and passes with the in-process write. The five Claude hook
integration tests pass.
This addresses the synchronous process overhead. Async registrations
still need ordered writes and Git config lock handling, so #4618 stays
open for that work.
Refs #4618 — automated triage
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
The `feature-powerset` check on #4597 failed because
`background_removal_preserves_native_path_arguments` expected staged
trash to be empty immediately after removal. A concurrently forked child
can briefly inherit the trash drain lock, so the test's one cleanup
attempt may leave the staged entry behind. The test now uses the bounded
`wait_for` helper to retry cleanup and still verifies the checkout and
registration are removed. This follows the same accepted fix for another
drain test in #4530.
The [failed feature powerset
job](https://github.com/max-sixty/worktrunk/actions/runs/40644576267/job/122670315541)
exercised the original assertion. The targeted test passes locally after
the change. The full `cargo run -- hook pre-merge --yes` gate ran 5,463
tests and reported seven failures outside this test; some require socket
operations unavailable in this sandbox. CI on this PR will provide the
complete verification.
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
A branch-deletion failure can be lost after its checkout has already
been removed. Return a contextual error through foreground and silent
callers after arranging teardown, while preserving partial JSON results,
including `retained_failed`, and the underlying cancellation signal.
Later failures in an already detached cleanup child continue to go to
its log.
The destructive Git command owns checkout-removal errors and
surviving-entry details. Preflight and staging refusals keep their own
diagnostic, so they do not imply that deletion partly succeeded; actual
partial failures still list survivors.
Validation: 160 removal integration tests, 83 prune integration tests,
and the cancellation and silent-picker unit regressions pass. The full
project gate passes: 5,447 tests plus Clippy, formatting, docs,
doctests, and lockfile checks. Independent source review found no
remaining defects.
> _This was written by Codex on behalf of max-sixty_
Restore the completed/total task counter removed in #4333 while keeping
the inventory and clipped-row counts. The initial frame says “loading
details…” until the task plan exists, then shows `N/M tasks complete`,
including results for off-screen rows. Progress comes first so it
remains visible in narrow terminals; stalled loading keeps the counter
and identifies pending work.
PTY regressions cover full and clipped tables at 150 and 60 columns,
checking monotonic progress and matching totals. A gated summary task
exercises the actual stall callback at `1/2` complete, then verifies
progress reaches `2/2` after release. All 12 focused progress/stall
tests passed, and live Leaf checks passed at 80 and 60 columns.
> _This was written by Codex on behalf of max-sixty_
A final alias child can catch Ctrl-C and exit successfully before wt's
signal-owning thread finishes handling its SIGINT. Retiring the final
foreground scope on another thread can restore idle default handling
during that receipt, killing wt instead of preserving the child's exit
status.
Retire foreground scopes on the existing process owner, which already
serializes signal receipt with child admission. Add a controlled
regression that pauses receipt while a real child handles Ctrl-C and
exits successfully, cover nested owner requests and panic propagation,
and preserve exit status and stderr in the alias test's failure
diagnostic.
Includes the receipt handshake from
[#4607](https://github.com/max-sixty/worktrunk/pull/4607): the alias
test keeps its child alive until wt records receiving SIGINT. This
separates an interrupt received during the command from one that arrives
after the child has exited. The controlled unit regression independently
exercises teardown during an already-entered handler.
The regression fails against main and passes with the fix on Linux and
macOS. Validation: full project gate (5,442 tests passed, one skipped),
Linux signal/process-owner tests, and all 91 Linux alias tests.
Fixes#4603.
> _This was written by Codex on behalf of max-sixty_
---------
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
wt wrote the `cd` target followed by a newline, and each reader removed
it its own way: fish, PowerShell and Nushell trimmed all surrounding
whitespace, bash and zsh dropped trailing newlines, and wt's existence
check from #4602 stripped line terminators. So a directory whose name
ends in a space worked in bash and zsh but not in the other three.
wt now writes the bare path, and every reader takes the contents as-is:
fish reads with `string collect`, PowerShell and Nushell drop their
trims, and wt's existence check strips nothing. I checked all five
wrappers `cd` into a directory named `dir ` (fish failed before).
A hand-written directive ending in a newline (a hook using `echo`) is
now read with the newline included; wt's own writes and the tests
already use the bare path.
> _This was written by Claude Code on behalf of max-sixty_
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Authentication probes print their credentials, which captured-output
logging previously copied into debug logs, diagnostics, and stderr under
`RUST_LOG=debug`. Add `Cmd::sensitive_output()` and apply it to GitHub
and GitLab token probes so callers retain the original output while both
subprocess logging targets emit `[redacted]`. Status and timing remain
available, including for failed probes; pipelines propagate sensitivity
to both commands.
Use one permission-preparation helper for debug, diagnostic,
command-history, and background-hook logs. On Unix it applies `0600` to
regular files and `0700` to log directories, including existing paths
and command-log rotation. Initialization also secures existing active
and rotated audit logs when the current command writes no audit entry.
Permission repair handles read-only files without opening audit streams,
so FIFOs cannot block initialization. Preserve native file-opening
behavior for FIFO log destinations and keep `RUST_LOG` filtering
consistent across full and bounded output.
Validation: the full project pre-merge gate passed with 5,446 tests
passing and one skipped, plus formatting, Clippy, doctests, and rustdoc.
Regression coverage checks fake credentials across all logging
destinations, returned output, failures, concurrent commands, pipelines,
and new/existing log permissions. Disabling redaction made all three
auth-probe regression cases fail on leaked fake credentials.
> _This was written by Codex on behalf of max-sixty_
Commit subjects and forge metadata could emit terminal commands in
styled output, including OSC 52 clipboard sequences. Escape control
bytes with the existing helper before truncating or styling the list
message and PR/MR context. JSON retains the original subject.
Regression tests reproduce both input paths and verify that application
styling remains enabled. Both also passed real 80-column xterm PTY
probes. Independent review found no issues.
Local validation: linting, documentation, and doctests passed. The full
gate ran 5,443 tests: 5,440 passed and three failed in
foreground-process, fish-wrapper, and detached-removal tests outside the
changed paths.
> _This was written by Codex on behalf of max-sixty_