feat(editor): F4.6b the command line on a computer's desktop
A new oracle, TerminalWindowRun, types into Java's own command line window: the window writes each line after its prompt, takes a blank line, cls, reset and exit itself, keeps the lines for the arrow keys, and keeps its text, history and working directory over a stop and a start. The room now holds a command line window per computer for everyone (TerminalWindow), kept over stops; the protocol carries its lines and the one way to read them (terminalScreen); the core goes on in the working directory of the run before (continueIn). The desktop opens programs in Java's frame, and the command line works with keyboard and finger: grey on black, the prompt hidden while a command runs, history, chips for the commands, Ctrl+C. The room's failure is now tested in the browser. Fixed: the room handed the engine the wall clock with fractions of a millisecond, and a ping hung after its first timeout. The engine and the room count whole milliseconds, as Java's clock does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1239,3 +1239,29 @@ Gemessen (03.10.2026):
|
||||
Karte; ohne Karte behält der Router kein Gateway (`setStandardGateway`
|
||||
schreibt es in die Karten, `getStandardGateway` liest `null`).
|
||||
|
||||
### Das Fenster der Befehlszeile (F4.6b)
|
||||
|
||||
`TerminalWindowRun` öffnet Javas `GUIApplicationTerminalWindow` auf einem
|
||||
`GUIDesktopPanel` eines Rechners ohne Netz, gibt Tasten direkt an den
|
||||
Tastenhörer des Eingabefelds (Enter, Pfeil hoch/runter), stoppt und startet
|
||||
das System einmal (`beenden`, `starten`, wie ein Moduswechsel) und schreibt
|
||||
nach jeder Taste Text, Prompt, ob er sichtbar ist, und die Eingabezeile
|
||||
(`packages/sim/test/terminalWindow.java.json`).
|
||||
|
||||
Gemessen (03.10.2026):
|
||||
|
||||
* Eine leere Zeile, auch nur aus Leerzeichen (`StringUtils.isBlank`), gibt
|
||||
„␣␣\n“; jede andere Zeile steht danach als „\n“ + Prompt + Zeile + „\n“
|
||||
im Fenster, auch `cls`, `reset` und `exit`, bevor das Fenster sie selbst
|
||||
erledigt.
|
||||
* `cls`/`reset` zeigen wieder den Startbildschirm; `exit` schließt das
|
||||
Fenster, sein Text bleibt.
|
||||
* Pfeil hoch geht durch alle eingegebenen Zeilen zurück (leere nicht),
|
||||
runter vor, unter der neuesten steht eine leere Zeile; über die Enden
|
||||
hinaus bleibt es stehen.
|
||||
* Der Prompt folgt dem Arbeitsverzeichnis, nachgeführt, wenn ein Befehl
|
||||
fertig ist (`cd dir` → „/dir> “).
|
||||
* Nach Stopp und Start bleiben Text, Verlauf **und** Arbeitsverzeichnis:
|
||||
Javas Terminal setzt den Ordner nur bei der Installation
|
||||
(`setSystemSoftware`), und das Fenster ist dasselbe Objekt.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user