StartAutomating / Posh

PowerShell made Posh
https://posh.startautomating.com/
MIT License
59 stars 6 forks source link

Posh Little Boxes #334

Open StartAutomating opened 8 months ago

StartAutomating commented 8 months ago

Posh should support terminal boxes/borders around content.

These can be simply expressed in a string, and the spaces in that string can be used to content placement.

$Posh.Host.UI.Boxes # should return the known boxes

Boxes should be defined in NoteProperties of Posh.Host.UI.Boxes.

Boxes should normally be defined by a simple string.

For example, a "box" could be made out of "*"

$Posh.Host.UI.Boxes.Add("Star", '*')

A box could also be provided by a grid of characters, for example:

$Posh.Host.UI.Boxes.Add("PipeDash", @'
|-|
| |
|-|
'@)

The blank spacing in this box could be filled with content, and the characters bracketing that blank space can be extended.

This logic gets even more interesting if the box definition is a 5x5 matrix:

$Posh.Host.UI.Boxes.Add("Double", @'
╔═╦═╗
║ ║ ║
╠═╬═║
║ ║ ║
╚═╩═╝
'@)

Essentially, can define what all types of intersection should look like within a box, we can extend that box infinitely.

There should be several of these built-in boxes.

After several have been defined, we should start work on the Box pseudotype: