diff --git a/frontend/src/routes/playground/+page.svelte b/frontend/src/routes/playground/+page.svelte index ede1f79..4c0e75b 100644 --- a/frontend/src/routes/playground/+page.svelte +++ b/frontend/src/routes/playground/+page.svelte @@ -43,12 +43,16 @@ const file = activeFile; if (!file || $playgroundStore.running) return; - const stdin = $playgroundStore.consoleInput; - playgroundStore.setConsoleInput(''); + const stdin = playgroundStore.consumeStdin(); playgroundStore.setRunning(true); playgroundStore.appendConsole( consoleLine('info', `$ run ${file.name} [${codeLanguage}]`) ); + if (!stdin) { + playgroundStore.appendConsole( + consoleLine('info', '(tanpa stdin — program yang membaca input akan mendapat EOF)') + ); + } try { const res = await compileCode({ @@ -190,7 +194,7 @@ {:else if activeTab === 'code'}
- activeTab = 'code'} /> + activeTab = 'code'} />