fix(playground): Kirim menambah baris ke stdinQueue, bukan hanya history

This commit is contained in:
a2nr 2026-08-01 22:36:52 +00:00
parent a14eb70038
commit a92411fa45
1 changed files with 5 additions and 2 deletions

View File

@ -19,6 +19,9 @@
function sendInput() {
const text = get(playgroundStore).consoleInput.trim();
if (!text) return;
// Tambah ke antrean stdin (bukan hanya history)
playgroundStore.enqueueStdin(text);
// Tetap tampilkan di console history sebagai baris input
const line: ConsoleLine = { type: 'input', text, timestamp: Date.now() };
playgroundStore.appendConsole(line);
playgroundStore.setConsoleInput('');
@ -89,7 +92,7 @@
value={$playgroundStore.consoleInput}
oninput={(e) => playgroundStore.setConsoleInput(e.currentTarget.value)}
onkeydown={handleKeydown}
placeholder="Input program (stdin) — dikirim saat Run…"
placeholder="Ketik input, enter/Kirim untuk antre, lalu Run…"
/>
<button class="console-send" onclick={sendInput}>Kirim</button>
</div>