Outputs a string to the CLI without any surrounding newlines.
Useful for showing repeating elements on a single line.

@param string      $text
@param string|null $foreground
@param string|null $background