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

feat: setting column on spawned process #459

Closed
privatenumber opened this issue May 21, 2021 · 4 comments
Closed

feat: setting column on spawned process #459

privatenumber opened this issue May 21, 2021 · 4 comments

Comments

@privatenumber
Copy link

Feature request

Would like to be able to specify the column and rows for the stdout of the spawned process.

Motivation

I'm using execa to spawn a command that is printing text that is wrapped. It doesn't wrap when I run it directly or if I set stdio: 'inherit'.

@sindresorhus
Copy link
Owner

This is not possible. There's no column / row on the spawned process. You need a PTY for that, like https://github.com/microsoft/node-pty

See this Node.js issue: nodejs/node#31409

I agree, it would be very useful.

@privatenumber
Copy link
Author

Ah I see. That's a shame...

Thanks for those links. Upvoted the Node.js issue—let me know if there's anything else I can do to help push for it.

I was experimenting and I saw I could pass in new tty.WriteStream(1) as the stdout and it would work fine but print to the actual stdout (so basically I was just inheriting the stdout).

I'm not very good with streams/tty, so excuse me if I'm just completely off, but I was wondering if it's possible to pass in a fake tty write stream that just collects the output. Probably not though if it's just a wrapper for the internal tty binding.

@sindresorhus
Copy link
Owner

sindresorhus commented May 21, 2021

but I was wondering if it's possible to pass in a fake tty write stream that just collects the output. Probably not though if it's just a wrapper for the internal tty binding.

Not as far as I know, but it's been years since I tried to do something like that.

Maybe try asking on Stack Overflow? The answer (if any) would benefit a lot of Node.js people.

@ehmicky
Copy link
Collaborator

ehmicky commented Dec 18, 2023

Closing as the issue is not related to Node.js.

@ehmicky ehmicky closed this as completed Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants