node
node copied to clipboard
Set the current terminal window size.
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
AFAIK there isn't a way to do this natively, as different terminals support different operations
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 ...
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.
@nodejs/process WDYT?
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.
Adding stalled
, for a member of the team to respond.
:repeat: @nodejs/process
The stalled
bot ins't working... I closed this manually.