fix(cli): preserve percent signs in project roots - #92
Merged
Conversation
ALX99
force-pushed
the
master
branch
4 times, most recently
from
July 19, 2026 10:20
7031eab to
e784de7
Compare
ALX99
marked this pull request as draft
July 19, 2026 18:03
ALX99
force-pushed
the
bug/projselect-percent-root
branch
from
July 19, 2026 18:04
7eb7cd1 to
dac1df6
Compare
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.
Problem and impact
.local/bin/_projselectused the user-configurablePROJ_DIRvalue as part ofprintf’s format string. A valid project root containing a percent directive such as%scorrupted the selected path. For example, selectingalphaunderprojects%sproducedprojectsalpha/instead ofprojects%s/alpha.This breaks the project picker for legal Unix path names and can send callers to a path different from the one selected.
Reproduction and observed result
Validated against untouched
mastercommite784de73852fa5d7744a5ffffed7143567fe0748using the exact parent script and temporaryuname,find, andfzfstubs. The stubs reported Linux, emitted one project namedalpha, and selected that row.Observed on the parent revision with GNU Bash 5.2.37:
Expected:
/tmp/.../projects%s/alpha.Root cause and fix
The parent implementation evaluated:
The
%sembedded inPROJ_DIRbecame an additional conversion directive. The fix first captures the picker result, then uses a constant format string:Both path components are now emitted literally. Discovery, preview, selection, and cancellation behavior are unchanged.
Validation commands and results
The same deterministic harness against the fixed file produced:
Additional checks:
GitHub comparison reports the branch is one commit ahead of and zero commits behind current
master, with only.local/bin/_projselectchanged. The triggeredLinterworkflow passed.A fresh shell clone was attempted but the runtime could not resolve
github.com; repository reads and branch operations therefore used the GitHub integration. ShellCheck was installed through the configured internal Debian mirror.Scope and risk
The branch contains one clean commit based on current
master. It adds no tests, fixtures, temporary harnesses, generated files, dependency changes, or unrelated cleanup. The change is limited to safe output formatting after the existing picker completes.