fix: honor builtin redirections, propagate exit codes, fix $VAR expansion#2
Merged
Merged
Conversation
… fix $VAR expansion Tier 1 scripting fixes (all TDD, 248 tests pass): - executor: process_command_line now returns execute_ast status, so `kishi -c "false"` exits 1; non-interactive mode exits with last status - builtins: kishi_exit honors `exit N` code (ValueError -> 1); goodbye to stderr - executor: single builtin/function path applies stdout/stderr redirection via contextlib (_run_redirected) — pure-Python, identical on Linux & Windows - executor: redirect targets expanded (Expander.expand globbing=False) so `> $VAR` and `> ~/x` resolve correctly - expander: only a bare `$VAR` token takes the drop-if-empty path; `$VAR/suffix` and `$VAR.txt` now expand the variable portion and keep the suffix - main: `-c` and piped/non-interactive modes no longer run .kishirc command lines (bash -c parity); aliases/exports still load Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ozhangebesoglu
added a commit
that referenced
this pull request
May 21, 2026
Bugfix release: builtin redirections, exit-code propagation, $VAR/suffix expansion, and -c/pipe rc-pollution fixes (PR #2).
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.
Özet
Scripting'i bozan 6 bug, TDD ile düzeltildi (248 test geçiyor, sıfır regresyon).
kishi -cexit kodu hep 0process_command_lineartıkexecute_aststatüsünü döndürür; non-interactive son statüyle çıkarexit Nyok sayılıyordukishi_exitint(args[1])kodunu onurlandırır (ValueError→1); mesaj stderr'e_run_redirected(contextlib, Linux & Windows aynı) —pwd > fdosyaya yazarExpander.expand(globbing=False)→> $VAR,> ~/xçözülür$VAR/suffixboş dönüyordustartswith('$')→re.fullmatch;$VAR/x,$VAR.txtçalışır-c/pipe.kishirckomutlarını çalıştırıp stdout kirletiyorduTest
248 passed— 20 yeni test (test_executor.py,test_expander.py,test_main.py) + 228 mevcutcontextlib(mevcuttui_dashboard.pydeseni); fork yolu dokunulmadıPlan
Detaylı fazlı plan:
docs/superpowers/plans/2026-05-21-tier1-redirect-exitcode-plan.md🤖 Generated with Claude Code