Skip to content

Shell append operator (>>) wedges the console instead of failing cleanly #650

Description

@LSantha

Summary

Using the append-redirection operator >> (which JNode's shell does not support — only <, >, | exist) does not produce a clean syntax error: it wedges the shell. No prompt returns, Ctrl-C/Ctrl-Z do not recover it, and only a power cycle restores the console.

Environment

  • JNode 0.2.9-dev (x86 32-bit), VirtualBox 7.2.6, serial console
  • Observed 2026-09-17

Reproduction

echo 'HashProbe5' >> /devices/hdb1/mini.txt
# -> misplaced Token{'>'}
# (no prompt ever returns; --interrupt / --suspend have no effect)

Single > redirection to the same path works fine. Other command syntax errors (unknown alias, bad flags) correctly print an error and return to prompt, so the machinery for clean rejection exists — the >> token path specifically leaves the interpreter in a state from which it never recovers.

A second, milder sharp edge in the same area: sending a command containing real newline bytes inside a quoted argument (instead of \n escapes) similarly wedges the shell waiting for quote termination, with Ctrl-C unable to cancel the line editor state. (The serial --write helper works around this, but interactive users over serialconsole will hit it.)

Expected behavior

misplaced Token{'>'} (or a "not supported" message) followed by a fresh prompt — consistent with every other shell syntax error.

Suspected component

shell/ command framework — RedirectingInterpreter / the bjorne tokenizer's >> path (org.jnode.shell).

Impact

One typo (>> instead of >) costs a full power cycle + reboot (~1 min on fast storage, plus loss of all un-synced work and RAMFS state). High annoyance rate for anyone driving the VM over serial, where muscle memory from bash is strong.

Triage Addendum (auto, 2026-09-24)

  • Area / Kind: area/shell + kind/bug
  • Blast radius: L2 package (shell interpreter and shell tests; suspected parser/line-editor state, unconfirmed)
  • Expected scope: Restrict the fix to shell parsing/input recovery and focused tests; do not add >> support or change unrelated shell operators, pending a confirmed fault site.
  • Test path: cd shell && ant test; interactive serial-console regression still required.
  • Merge signal: human-review (interactive hang affects recovery and test coverage is not yet reproducible)
  • Gaps: Missing build target and commit, full boot command, serial log excerpt, and a separate exact reproduction for the real-newline quoted-argument case.
  • Full report: ## Triage comment below.

✅ Ticket Runner Status

Field Value
Phase DONE
Turn 0/3
Retries 0/3
PR -
Started 2026-09-25T07:12:57.852Z

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/needs-infoThe agent has posted clarifying questions; waiting for the reporter.area/shellshell/ — command framework, built-in commands, bjorne evaluator.kind/bugConfirmed bug report with a repro or stack trace.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions