blessed icon indicating copy to clipboard operation
blessed copied to clipboard

How to set box exact height and width?

Open lucentminds opened this issue 2 years ago • 1 comments

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?

lucentminds avatar Dec 14 '22 19:12 lucentminds

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.

tracker1 avatar Dec 17 '22 23:12 tracker1