Fix dev console bar when columns has small value

This commit is contained in:
KernelDeimos
2024-04-01 22:01:34 -04:00
parent 7442b48157
commit 5d81ff4cbe

View File

@@ -179,6 +179,11 @@ class DevConsoleService extends BaseService {
generateSeparator(text) {
text = text || '[ Dev Console ]';
const totalWidth = process.stdout.columns;
if ( totalWidth <= text.length+1 ) {
return '═'.repeat(totalWidth < 0 ? 0 : totalWidth);
}
const paddingSize = (totalWidth - text.length) / 2;
// Construct the separator