terminal: _processCommand=true throws TypeError on unknown commands #1100

Closed
opened 2026-08-13 14:40:35 +00:00 by spikerj · 1 comment
Owner

TerminalComponent.processLine() treats _processCommand as the user-command dispatcher:

if (!this.isCoreCommand(cmd)) {
  if (this._processCommand) {
    stdout = this.coreCommand(argv, argc);
  } else {
    stdout = cmd + ": command not found\n";
  }
}

_processCommand is hardcoded false, so the arm is dead. If it is ever flipped on, coreCommand does _coreCmds[cmd](...) and throws TypeError: this._coreCmds[cmd] is not a function for any name that is not clear, instead of printing "command not found".

Expected: unknown names still print "command not found" (or dispatch a real user-command table). Characterization: terminal.leftovers.spec.ts.

`TerminalComponent.processLine()` treats `_processCommand` as the user-command dispatcher: ```ts if (!this.isCoreCommand(cmd)) { if (this._processCommand) { stdout = this.coreCommand(argv, argc); } else { stdout = cmd + ": command not found\n"; } } ``` `_processCommand` is hardcoded `false`, so the arm is dead. If it is ever flipped on, `coreCommand` does `_coreCmds[cmd](...)` and **throws** `TypeError: this._coreCmds[cmd] is not a function` for any name that is not `clear`, instead of printing "command not found". Expected: unknown names still print "command not found" (or dispatch a real user-command table). Characterization: `terminal.leftovers.spec.ts`.
Author
Owner

Resolved in spikersoft-angular PR #818 (merged to master). Unknown names no longer throw TypeError when _processCommand is on; they print command-not-found. Closing.

Resolved in spikersoft-angular [PR #818](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/818) (merged to `master`). Unknown names no longer throw TypeError when `_processCommand` is on; they print command-not-found. Closing.
Sign in to join this conversation.