blessed icon indicating copy to clipboard operation
blessed copied to clipboard

center tag doesn't work

Open ElModdy opened this issue 6 years ago • 0 comments

Hi, I modified one of the example but it doesn't work. I would like to center the title. This is what I tried.

var blessed = require('blessed');
 
// Create a screen object.
var screen = blessed.screen({
  smartCSR: true
});
 
screen.title = 'my window title';


var content = '{center}Title {bold}FOO{/bold}{/center}\nThis is some random text'

// Create a box perfectly centered horizontally and vertically.
var box = blessed.box({
	top: 'center',
	left: 'center',
	width: 'shrink',
	height: 'shrink',
	content: content,
	tags: true,
	border: {
		type: 'line'
	},
	style: {
		fg: 'white',
		bg: 'magenta',
		border: {
			fg: '#f0f0f0'
		}
	}
});
 
// Append our box to the screen.
screen.append(box);
 
// Quit on Escape, q, or Control-C.
screen.key(['escape', 'q', 'C-c'], function(ch, key) {
  return process.exit(0);
});
 
// Focus our element.
box.focus();
 
// Render the screen.
screen.render();

This is what I see: prova

ElModdy avatar May 20 '19 07:05 ElModdy