Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] JS input not working #399

Open
markNZed opened this issue Feb 1, 2025 · 0 comments
Open

[BUG] JS input not working #399

markNZed opened this issue Feb 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@markNZed
Copy link

markNZed commented Feb 1, 2025

I can't get input working with JS, it does work with Python. I'm using Obsidian 1.8.4 with Code Executor 2.0.0 on Ubuntu (.deb install).
and an input box but entering a value and hitting enter prints the input and shows another input box.

If I then clear the input I see a spinner next to the code block i.e. it appears to hang.

Describe the bug
I can't get input working with JS, it does work with Python.

Software Version
Ubuntu 24.04 (.deb install), Obsidian 1.8.4, Code Executor 2.0.0

To Reproduce
This code runs and no input appears

const readline = require('node:readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});

rl.question(`What's your name?`, name => {
  console.log(`Hi ${name}!`);
  rl.close();
});

When I run it again sometimes I see this output:

What's your name?SIGIL_BLOCK_DONE_0.2493097777811717_1738408211384_234Hi try { eval("\n\n\n\nconst readline = require('node:readline');\n\nconst rl = readline.createInterface({\n  input: process.stdin,\n  output: process.stdout,\n});\n\nrl.question(`What's your name?`, name => {\n  console.log(`Hi ${name}!`);\n  rl.close();\n});\n\n\n"); }catch(e) { console.error(e); }finally { process.stdout.write("SIGIL_BLOCK_DONE_0.2493097777811717_1738408211384_234"); }!

Expected behavior
Input box and rturn value that allows the script to proceed

Screenshots

@markNZed markNZed added the bug Something isn't working label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant