Repository navigation
feat(picker): free digit keys for typing; preview tabs to Alt + Tab/Shift-Tab - #3079
Merged
Merged
Conversation
…d Tab The interactive `wt switch` picker bound bare digits 1–5 to preview-mode switching, so a number could never reach the fuzzy query. Free the bare digits (they now filter the list — PR numbers, digits in branch names) and move preview-tab switching to: - Alt-1..Alt-5 — jump directly to a tab - Tab / Shift-Tab — cycle tabs forward / backward, wrapping Alt-digit needs a vendored skim-tuikit patch: `from_keyname` had `alt-a`..`alt-z` but no `alt-0`..`alt-9`, so the keymap silently failed to bind (Input::bind drops unparsable keys), even though the input reader already decodes ESC+digit to Alt(digit). Added the ten arms, matching fzf. The cycle binding rotates the mode digit held in the state file with a paren-free, shell-agnostic `tr` one-liner (`tr 12345 23451 < f > f.tmp; mv f.tmp f`): skim parses the execute-silent argument only up to the first `)`, ruling out `$(( ))`, and runs it under the user's $SHELL (fish/zsh/sh). Legend, loading-placeholder hint, `wt switch --help`, and the generated doc mirrors are updated to match. The four panel tests now drive Alt-N; three new tests cover the Tab/Shift-Tab cycle including both wraparounds. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
worktrunk-bot
approved these changes
Jun 15, 2026
This was referenced Jun 15, 2026
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
worktrunk 0.59.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## Release Notes ### Improved - **Picker frees digit keys for filtering; preview tabs move to `Alt`**: In the `wt switch` picker, plain digits now go to the filter, so a branch name with a number in it can be typed directly. Preview tabs jump with `Alt-1`–`Alt-5` or cycle with `Tab`/`Shift-Tab`. (Breaking: `1`–`5` no longer switch preview tabs) ([#3079](max-sixty/worktrunk#3079)) - **Squash templates use `commit_details` instead of `commits`**: The squash commit-message template's `{{ commits }}` variable (commit subjects) is deprecated in favor of `{{ commit_details }}`, which renders as the bare subject when printed directly and also exposes `.subject` and `.body`. `wt config update` migrates `commits` to `commit_details` as a plain rename. ([#2985](max-sixty/worktrunk#2985)) - **`wt step eval -v` lists template variables**: `wt step eval -v` now prints the available template variables on stderr in the gutter style, above the template-expansion view. That expansion (also shown by `wt switch -v`, hooks, aliases, and `wt -v list`) renders the template and its result as separate labeled `source` / `result` blocks rather than a shared gutter. The result still goes to stdout, so `$(wt step eval …)` is unchanged. Since `eval` mutates nothing and is experimental, its `--dry-run` flag (which dumped the raw variable context) is removed rather than deprecated. ([#3078](max-sixty/worktrunk#3078), [#3099](max-sixty/worktrunk#3099)) ### Fixed - **Picker no longer freezes on the first keystroke**: With many worktrees, typing the first character in the `wt switch` picker locked the UI for several seconds. The fuzzy matcher shares rayon's global thread pool with worktrunk's git collection, which floods it with blocking subprocess calls, so the matcher queued behind them. Collection and preview work now run on a dedicated pool, keeping the matcher responsive. ([#3087](max-sixty/worktrunk#3087), thanks @bendrucker; fixes [#2926](max-sixty/worktrunk#2926), thanks @mahume for reporting) - **Tab-completion covers all hook types**: `wt hook <type> <Tab>` completed configured command names for only seven of the ten hook types; `pre-switch`, `post-switch`, and `post-remove` returned nothing. Completion now derives the type from the canonical hook list, so every type completes its command names. ([#3070](max-sixty/worktrunk#3070)) - **Ctrl-C on a concurrent alias reports the right exit code**: Interrupting `wt step <concurrent-alias>` could report exit 143 (SIGTERM) instead of 130 (SIGINT), because a per-child SIGINT → SIGTERM → SIGKILL escalation could land a SIGTERM on a child during the grace window; the escalation also serialized across process groups, so repeated Ctrl-C could wait. wt now forwards the user's signal once per process group, so a cooperative child dies from the signal actually sent (130 on Ctrl-C); a second signal kills any survivor immediately. ([#3075](max-sixty/worktrunk#3075)) ### Documentation - **Per-worktree env vars**: A Tips & Patterns section shows how to give each worktree its own environment variables with direnv or mise. ([#3074](max-sixty/worktrunk#3074)) ### Internal - The commit-generation command is not rewritten to disk when its value is unchanged. ([#3084](max-sixty/worktrunk#3084)) ## Install worktrunk 0.59.0 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-installer.sh | sh && wt config shell install ``` ### Install prebuilt binaries via powershell script ```sh powershell -ExecutionPolicy Bypass -c "irm https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-installer.ps1 | iex"; git-wt config shell install ``` ### Install prebuilt binaries via Homebrew ```sh brew install worktrunk && wt config shell install ``` ## Download worktrunk 0.59.0 | File | Platform | Checksum | |--------|----------|----------| | [worktrunk-aarch64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-aarch64-apple-darwin.tar.xz.sha256) | | [worktrunk-x86_64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-x86_64-apple-darwin.tar.xz.sha256) | | [worktrunk-x86_64-pc-windows-msvc.zip](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-x86_64-pc-windows-msvc.zip.sha256) | | [worktrunk-aarch64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-aarch64-unknown-linux-musl.tar.xz) | ARM64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-aarch64-unknown-linux-musl.tar.xz.sha256) | | [worktrunk-x86_64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-x86_64-unknown-linux-musl.tar.xz) | x64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.59.0/worktrunk-x86_64-unknown-linux-musl.tar.xz.sha256) | ### Install via Cargo ```sh cargo install worktrunk && wt config shell install ``` ### Install via Winget (Windows) ```sh winget install max-sixty.worktrunk && git-wt config shell install ``` ### Install via AUR (Arch Linux) ```sh paru worktrunk-bin && wt config shell install ``` </pre> <p>View the full release notes at <a href="https://github.com/max-sixty/worktrunk/releases/tag/v0.59.0">https://github.com/max-sixty/worktrunk/releases/tag/v0.59.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!11836
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The interactive
wt switchpicker bound the bare digit keys1–5to preview-mode switching, so skim consumed them before they could reach the fuzzy query — a number could never be typed to filter. This frees the bare digits (they now go to the query — useful for digits in branch names, and for the PR/MR numbers the--prswork will add) and moves preview-tab switching onto modifiers.Behavior
1–5Alt-1–Alt-5Tab/Shift-TabAlt-1–Alt-5carries the same Meta-key requirement the existingalt-c/alt-r/alt-pbindings already rely on;Tab/Shift-Tabworks regardless, so the cycle is the universal path and Alt-digit is the accelerator.Navigating the diff
vendor/skim-tuikit/src/key.rs— the load-bearing enabler.from_keynamehadalt-a..alt-zbut noalt-0..alt-9, so analt-1:…keymap silently failed to bind (Input::binddrops keys it can't parse), even though the terminal reader already decodes ESC+digit toAlt(digit)(input.rs:333). Added the ten arms, matching fzf'salt-1..alt-9; documented in theCargo.toml[patch.crates-io]block andvendor/NOTES.mdas a clean upstream-PR candidate.src/commands/picker/mod.rs— the.bind(vec![…])block:alt-1..alt-5jumps plus thetab/btabcycle. The cycle rotates the mode digit in the state file withtr 12345 23451 < {0} > {0}.tmp; mv {0}.tmp {0}. That command shape is forced by two constraints, both documented inline: skim parses theexecute-silent(…)argument only up to the first)(so no$(( ))), and runs it under the user's$SHELL(sotr+mv, no shell-specific syntax).src/commands/picker/items.rs/preview.rs— legend controls line, loading-placeholder hint, and aDropthat cleans up the rotate scratch file.src/cli/mod.rs+ regenerateddocs/content/switch.mdandskills/worktrunk/reference/switch.md(test_docs_are_in_syncpasses).Testing
The four
preview_paneltests now driveAlt-N. Three new PTY tests cover the cycle end-to-end under the real shell: forward (1→2), forward wraparound (5→1), and backward wraparound (1→5). The full gate (cargo run -- hook pre-merge --yes, including--features shell-integration-tests) is green: 3943 tests, clippy/fmt/typos clean. Bare-digit-to-query is structurally guaranteed (the bindings are simply removed) and intentionally not given a filter-query test, since the suite documents skim matcher-lag flakiness for query-driven tests.This branch is based on
main; reconciling with the sibling--prsbranch that motivated it is left to that branch.