Repository navigation
feat: keep the terminal for the fixed command under codigest capture - #10
Merged
Merged
Conversation
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.
With codigest's terminal capture on,
hf(andㅗㄹ) was captured like any typed line: its output went through codigest's pipe, so the fixed command it runs did too. An interactive one then failed, for examplecodexwith "stdout is not a terminal".codigest 9c4cf56 (NaNIsaac/codigest#53) added a contract for programs that run other command lines; this uses it in the bash, zsh and PowerShell functions:
CODIGEST_RUNNERS($global:CODIGEST_RUNNERSin PowerShell). codigest's hook does not capture a line that starts with one of them, sohfkeeps the terminal.__cdg_runwhen that function exists at the momenthfruns (PowerShell:. __cdg_run $fixed, in the caller's scope asInvoke-Expressionwas), otherwise toeval/Invoke-Expressionas before.__cdg_runapplies the hook's own rules:codex, editors and the like run plainly with the terminal, other commands are captured under the fixed line.README (English and Korean) gets one paragraph under "Fix the previous command". Version 0.2.6.
Tests
cargo test: the init scripts register both names (bash/zsh, PowerShell) and fish does not.tests/shells.ps1: the names are in$global:CODIGEST_RUNNERS, andhf -yhands the fixed line to a__cdg_runstand-in defined after hanfix.tests/shells.sh(bash, zsh on Linux CI): the same with a shell-function stand-in,runners: hf ㅗㄹandcdg_run:echo hanfix-ok.codex(a probe function) re-run withㅗㄹgets the terminal; a mistyped captured command re-run withhf -yis captured under its fixed line with its output; neitherhfline is captured. With hanfix 0.2.5 and the same hook thecodexprobe gets a pipe.local-ci: 4573909 | cargo test --release --locked 4 passed; tests/shells.ps1 with the built 0.2.6 (ok powershell, ok powershell with codigest); end-to-end above, 4/4; conventions.py check: 0 findings | tests/shells.sh (needs util-linux script) and macOS only in CI; real ssh session not run (owner check after release)