Repository navigation
feat: Add configurable history modes (shared/session/private) - #65
Closed
caomengxuan666 wants to merge 113 commits into
Closed
caomengxuan666 wants to merge 113 commits into
caomengxuan666 wants to merge 113 commits into
Conversation
GNU redir.c feeds raw bytes from input redirection targets to the reading owner. Rubash read_io.rs, read_redirected_fd.rs, and the trap_exec.rs fd-input registrations used strict fs::read_to_string, so invalid-UTF-8 records aborted exec 3<file or dropped read records to an EOF-style empty assignment. Add substitution_metadata::read_shell_input_file (bytes -> RAW_BYTE_MARKER shell text) and route all five sites through it. Pipeless probes now match GNU Bash 5.2.37 byte-for-byte (printf hi\377 > f; read x < f; printf %s > out => 68 69 ff), including procsub materialized inputs and exec-persistent fds replayed through redirected files. Remaining seams are documented in issue-suite-diff-analysis.md: pipeline stage text mirror, cmdsub scalar assignment carrier, coproc record lossy conversion, and builtin write-path decoders.
In-process pipeline stages converted capture buffers with String::from_utf8_lossy and fed child stdin plus final output with plain as_bytes, so builtin stages emitting raw bytes (printf format escapes, marker-decoded read records) were corrupted to U+FFFD before external consumers. Pipeline producers now encode once via substitution_metadata::bytes_to_shell_text (printf/trap/builtin/function/compound/lastpipe captures, external child stdout/stderr, host externals, cat file reads) and byte-boundary consumers decode once via the new inverse shell_text_to_raw_bytes (child stdin feeds, write_pipeline_output payload, stderr sinks). All seven handoff byte probes now match GNU Bash 5.2.37 byte-for-byte, including p3 command-substitution assignment replayed through a pipe. Full executor_tests failure set is identical to stashed HEAD (39 pre-existing); two new transport regressions pass in part_047 (37 total). New out-of-scope defect recorded: cmdsub-spawned cat cannot open absolute Windows paths while head -c can.
…idence Categorized arithmetic word-expansion errors now carry ExecuteError::ExpansionFailure: function frames absorb it as an early return, capture boundaries map it to status, and GNU-shaped diagnostics cover logical-RHS literal assignments and empty ternary branches. Rewrites four stale continue-expectation regression tests against live bash 5.2.37 probes; grand probe parity 19/24 with remaining brace-group/next-line/if-condition edges documented in docs/issue-suite-diff-analysis.md.
GNU Bash 5.2.37 probes y1/y3: the group tail is abandoned while the following command still runs with the carried status. Keep Break/Return/IoError propagation untouched.
GNU probe f4: a failing function call inside an if/elif condition must not be absorbed by the function frame; instead the entire if command is abandoned and the outer list continues. Gate frame absorption on inside_compound_condition.
y1/y3 brace frames and f4 if-condition abandonment are closed; z1/z2 deferred with hang-attribution notes from the reverted incremental file-feeder attempt.
Replaces the pre-session handoff: records the six pushed commits, raw-byte and arithmetic-fatality family closures with probe IDs, current gate numbers (363/12 cli, 33 arith, 37 part_047, 277 lib), open owner boundaries incl. deferred z1/z2 retry design, and new failed-experiment entries.
Member
Author
|
Closing this accidentally associated PR. The history mode change belongs to unixwin/niubash#66; this Rubash branch contains unrelated work and must not be merged here. |
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: In the default shared history mode, pressing arrow keys to navigate command history becomes unstable when multiple shell windows are open - entries from other shells appear and disrupt navigation.
Solution: Add WINUXSH_HISTORY_MODE environment variable with three modes:
Implementation:
Documentation:
All 206 runtime library tests pass.