Commit 6ddb20d
fix: Remove duplicate prompt by handling echo in JavaScript
The double prompt issue was caused by both WASM and JavaScript showing prompts.
Changes:
- WASM: Removed prompt echo from process_input (src/wasm.rs)
Web UI now handles all display, WASM just processes commands
- JavaScript: Echo ">command" to output history when user submits
This makes the prompt+command permanent in scroll history
InputArea shows live "> " that disappears after Enter
Flow now:
1. User sees "> " in InputArea (live, not in history)
2. User types "look" and presses Enter
3. JavaScript adds ">look" to permanent output history
4. InputArea disappears while processing
5. Game output appears
6. New InputArea shows "> " for next command
Result: Single prompt visible at any time, behaves like traditional terminal.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 3f4a19e commit 6ddb20d
2 files changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
437 | | - | |
438 | | - | |
| 436 | + | |
439 | 437 | | |
440 | 438 | | |
441 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
493 | 500 | | |
494 | 501 | | |
495 | 502 | | |
| |||
0 commit comments