Repository navigation
fix(builtins): shift status, ~+/~- tilde prefixes, shopt -o - #2580
Merged
Merged
Conversation
`shift N` past `$#` now fails with status 1 without shifting, and bad counts report bash's errors. `~+` and `~-` expand to PWD and OLDPWD. `shopt -o` acts on `set -o` option names. Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | af0673c | Commit Preview URL Branch Preview URL |
Oct 07 2026, 05:41 PM |
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.
Requested by Михайло · project thread
What changed
shift Nwith N greater than$#shifts nothing and returns 1.shift abcandshift -1fail with bash's messages.~+expands toPWDand~-toOLDPWD, including~+/x.~-stays literal whenOLDPWDis unset.shopt -oworks with-s,-u,-qand-ponset -ooption names.Why
Pseudo-linus oracle gaps: shift return code, tilde
~+/~-, andshopt -o.Before / After
set -- a; shift 2; echo $? $#0 01 1cd /tmp; cd /; echo ~+ ~-~+ ~-/ /tmpshopt -o noglobshopt: -o: invalid optionnoglob offNew spec
shell-misc-gaps.test.shhas 4 cases, all verified against bash.Risk
Low. Each change is local to its builtin or to tilde prefix handling. A
shiftpast the end used to clear the arguments; now it keeps them, as bash does.Checklist
cargo fmt,cargo clippy -D warningshttps://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code