node icon indicating copy to clipboard operation
node copied to clipboard

Set the current terminal window size.

Open Zibri opened this issue 9 months ago • 6 comments

What is the problem this feature will solve?

As we know, to get the actual window size, we can do:

process.stdout.on('resize', () => {
  console.log(`${process.stdout.columns}x${process.stdout.rows}`);
 }

As far as I know there is not the opposite: a way to set the window size programmatically. Setting process.stdout.rows and process.stdout.columns sort of works but does not really change the window size.

What is the feature you are proposing to solve the problem?

process.stdout.setRows(40); and process.stdout.setColumns(80);

to physically resize the window (tty/pty).

What alternatives have you considered?

No response

Zibri avatar May 04 '24 12:05 Zibri

AFAIK there isn't a way to do this natively, as different terminals support different operations

redyetidev avatar May 04 '24 13:05 redyetidev

AFAIK there isn't a way to do this natively, as different terminals support different operations

node-pty can do that. but it would be great to have it in node. at least for the main terminals, windows, linux, macos, msys2, cygwin, etc. afaik, only windows have some quirks.. everything else works fine. but node-pty is a pita ...

Zibri avatar May 06 '24 20:05 Zibri

node-pty uses custom native bindings. I am -1 on implementing new bindings to accommodate this feature, but I'm not the decider, so I'd love another opinion.

redyetidev avatar May 06 '24 20:05 redyetidev

@nodejs/process WDYT?

redyetidev avatar May 08 '24 19:05 redyetidev

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

github-actions[bot] avatar Jun 27 '24 22:06 github-actions[bot]

Adding stalled, for a member of the team to respond.

redyetidev avatar Jun 27 '24 22:06 redyetidev

:repeat: @nodejs/process

redyetidev avatar Jul 19 '24 16:07 redyetidev

The stalled bot ins't working... I closed this manually.

redyetidev avatar Sep 14 '24 00:09 redyetidev