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

bash node env vars for readline #2205

Closed
lokeb opened this issue May 22, 2024 · 3 comments
Closed

bash node env vars for readline #2205

lokeb opened this issue May 22, 2024 · 3 comments
Labels
missing code to replicate Can't replicate the issue until there is sample code stale no activity for 2 weeks

Comments

@lokeb
Copy link

lokeb commented May 22, 2024

Nodemon does not respect NODE_NO_READLINE=1 env variable. I need to set this env variable as documented here:
https://nodejs.org/api/repl.html#using-the-nodejs-repl-with-advanced-line-editors

Bash handles history and interrupts keyboard inputs like UP, DOWN, PGUP, PGDN. To use those keyboard inputs with Node, NODE_NO_READLINE=1 has to be set.

>$ NODE_NO_READLINE=1 node . //works
>$ NODE_NO_READLINE=1 nodemon . //does not work

In absence of this env var, keyboard inputs appear as escape sequences like [[^A, [[^B.

@remy
Copy link
Owner

remy commented May 30, 2024

I'm dropping directly into the repl - can you provide the script you're testing with?

Otherwise, when I run NODE_NO_READLINE=1 node (again, going directly into repl), and cursor up gives the same [[^A (on macos).

@remy remy added the missing code to replicate Can't replicate the issue until there is sample code label May 30, 2024
Copy link

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

@github-actions github-actions bot added the stale no activity for 2 weeks label Jun 13, 2024
Copy link

Automatically closing this issue due to lack of activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing code to replicate Can't replicate the issue until there is sample code stale no activity for 2 weeks
Projects
None yet
Development

No branches or pull requests

2 participants