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

Writing to process.stdout.columns causes an error. #26196

Closed
cshaa opened this issue Oct 12, 2024 · 0 comments · Fixed by #26201
Closed

Writing to process.stdout.columns causes an error. #26196

cshaa opened this issue Oct 12, 2024 · 0 comments · Fixed by #26201
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@cshaa
Copy link

cshaa commented Oct 12, 2024

The NPM package json-refs includes the following code:

// Set here so that commander does the right thing
process.stdout.columns = 120;

I have no idea what it's supposed to do, and it doesn't seem to be documented as writable. However, in Node and Bun, the line doesn't crash, whereas in Deno it throws:

error: Uncaught TypeError: Cannot set property columns of #<Writable> which has only a getter
    at Object.<anonymous> (file:///home/csha/.cache/deno/npm/registry.npmjs.org/json-refs/3.0.15/bin/json-refs:29:24)
    at Object.<anonymous> (file:///home/csha/.cache/deno/npm/registry.npmjs.org/json-refs/3.0.15/bin/json-refs:173:4)
    at Module._compile (node:module:748:34)
    at Object.Module._extensions..js (node:module:767:10)
    at Module.load (node:module:665:32)
    at Function.Module._load (node:module:537:12)
    at Object.loadCjsModule (ext:deno_node/02_init.js:64:22)
    at loadCjsModule ([ext:ext/node/lib.rs:782:29]:2:32)
    at [ext:ext/node/lib.rs:782:29]:3:7

This causes deno run npm:json-ref to crash, while npx json-ref and bunx json-ref work as expected.

Version: Deno 2.0.0

@marvinhagemeister marvinhagemeister added bug Something isn't working correctly node compat labels Oct 12, 2024
@littledivy littledivy self-assigned this Oct 13, 2024
littledivy added a commit that referenced this issue Oct 14, 2024
Behave similar to Node.js where modifying `stdout.columns` doesn't
really resize the terminal. Ref
nodejs/node#17529

Fixes #26196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants