chjj / blessed

A high-level terminal interface library for node.js.
Other
11.27k stars 533 forks source link

How to set box exact height and width? #427

Open lucentminds opened 1 year ago

lucentminds commented 1 year ago
const screen = blessed.screen();

screen.append(blessed.box({
   label: 'test 1',
   border: {
      type: 'line',
   },
   top: 0,
   left: 0,
   width: 10,
   height: 10,
}));

screen.render();

If I run this example script I get a rectangle that is taller than it is wide. How do I set the exact width and height of the box so that it's a square?

tracker1 commented 1 year ago

Change your font where each character is the same width as height... This is a terminal library, your size is going to be based on base level character size for your terminal characters... it's not a pixel based drawing library per se.