Skip to content

Tharga.Console 4.1 — fix #9, fix #10, IsVisible rename#33

Merged
poxet merged 5 commits into
masterfrom
feature/fix-delimited-params
May 11, 2026
Merged

Tharga.Console 4.1 — fix #9, fix #10, IsVisible rename#33
poxet merged 5 commits into
masterfrom
feature/fix-delimited-params

Conversation

@poxet
Copy link
Copy Markdown
Collaborator

@poxet poxet commented May 11, 2026

Summary

  • Fix Improper handling of delimited string parameter #9ParamExtensions.ToInput now preserves verbs and substitutes captured quoted strings back from their GUID placeholders. Previously quoted args caused the verb to be dropped and GUIDs to be returned in place of token content.
  • Fix Buffer insert position cannot be less than zero. #10InputInstance no longer throws InvalidOperationException and lock the console when the start anchor ends up above the cursor. Recovers by re-anchoring _startLocation to the current cursor and resetting the buffer position.
  • BREAKING: rename ICommand.IsHiddenIsVisible. Constructor parameter flipped from hidden = false to visible = true. Six in-repo subclasses (screen, startup, posh, run, exec, cmd) updated to pass false to preserve their previously-hidden behavior. Downstream consumers will see compile errors at positional-true call sites — that's the point of the major version bump.
  • Version bump to 4.1 via MAJOR_MINOR in .github/workflows/build.yml (3.7 → 4.1; 4.0 was already burned).

Closes #9. Closes #10.

Test plan

  • New ParamExtensions_tests covers the bug reproducer + mixed/unquoted/empty/single-quoted regression cases (5 tests).
  • New InputInstance_recovery_tests covers the recovery decision via the extracted RecoverNegativeBufferPosition helper (2 tests).
  • Full suite: 44 pass / 0 fail / 2 pre-existing skips on net10.
  • dotnet build -c Release clean (0 warnings, 0 errors across net8/net9/net10).
  • After merge: verify NuGet workflow publishes Tharga.Console, Tharga.Console.Standard, and Tharga.Console.Speech at 4.1.x.
  • After release: bump Tharga.Crawler (and other downstream consumers) to consume the new version and fix any breakage from the IsHiddenIsVisible rename.

poxet added 5 commits May 11, 2026 14:52
ToInput captured quoted strings into a GUID-keyed dictionary and rewrote
paramList to contain the GUID placeholders, but then returned just the
dictionary keys when any quoted argument was present. The unquoted verb
and the captured string content were both dropped.

Always split paramList on space and map any token matching a captured
GUID back to its captured value. The unquoted-only path is unchanged.
When the input start anchor ends up above the current cursor (window
resize, scroll, or external output moving the cursor up), the computed
buffer position went negative and InputInstance threw on every keystroke
afterwards, locking the console into an unusable state.

Replace the throw with a re-anchor: move _startLocation to the current
cursor position and reset the buffer position to 0. Input continues
instead of failing on every key.

Extracted the recovery decision into a pure static helper so it can be
unit-tested in isolation; in-loop behavior remains gated by the
existing currentBufferPosition < 0 check.
BREAKING CHANGE: ICommand.IsHidden is renamed to IsVisible, with
inverted semantics. The constructor parameter on CommandBase /
ContainerCommandBase / ActionCommandBase / AsyncActionCommandBase is
renamed from `hidden = false` to `visible = true`. The default is now
"visible" (positive framing), matching the new property name.

Downstream subclasses calling base(..., hidden: true) positionally now
need to pass `false` for visible; this repo's six built-in
previously-hidden commands (screen, startup, posh, run, exec, cmd) were
updated accordingly. External consumers will see compile errors at
positional call sites — that's the point of the major version bump.
@poxet poxet merged commit 92a921e into master May 11, 2026
4 of 5 checks passed
@poxet poxet deleted the feature/fix-delimited-params branch May 11, 2026 13:22
@github-actions
Copy link
Copy Markdown

Released as v4.1.0https://github.com/Tharga/Console/releases/tag/4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffer insert position cannot be less than zero. Improper handling of delimited string parameter

1 participant