Skip to content

createInterface from node:readline starts requiring --allow-env=TERM in Deno v2.3 #29441

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

Closed
imcotton opened this issue May 24, 2025 · 2 comments · Fixed by #29472
Closed

createInterface from node:readline starts requiring --allow-env=TERM in Deno v2.3 #29441

imcotton opened this issue May 24, 2025 · 2 comments · Fixed by #29472
Labels
needs discussion this topic needs further discussion to determine what action to take node compat

Comments

@imcotton
Copy link

Version: Deno 2.3.x

sample code:

import { Readable } from 'node:stream';
import { createInterface } from 'node:readline';

const input = Readable.from(`
    l1
    l2
    l3
`);

const stream = createInterface({ input });

const lines = await Array.fromAsync(stream, str => str.trim());

console.log(lines.filter(Boolean));

checkout the example repo's CI results:

https://github.com/imcotton/deno-readline-permission/actions/runs/15229175765

@bartlomieju
Copy link
Member

This is expected and caused by #28280 - before Deno v2.3.0, Node and npm packages silently ignored when an env var was not available which led to inconsistent behavior.

That said, we might want to add TERM env var to a list of env vars allowed by default.

@bartlomieju bartlomieju added needs discussion this topic needs further discussion to determine what action to take node compat labels May 26, 2025
@imcotton
Copy link
Author

Good to know the reasoning behind the issue, and I think it would be improved experience to put the TERM in allowed by default 👍

Besides from result from CI running, on Mac OS 15.3.2 (M4 mini) I find the require of TERM also present before Deno v2.3.x, I couldn't recall which version I have tested, but this seems not the case back in Deno v1 at some point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion this topic needs further discussion to determine what action to take node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants