private ConsoleLine NewLine()
        {
            var line = new ConsoleLine(_IdSequence++);

            _Lines.Add(line);
            return(line);
        }
        public IConsoleHost WriteLine(string text)
        {
            var targetLine = _CurrentLine ?? NewLine();

            var lines = text.Split('\n').Select(t => t.TrimEnd('\r')).ToArray();

            for (var l = 0; l < lines.Length; l++)
            {
                if (l > 0)
                {
                    targetLine = NewLine();
                }
                targetLine.AddFragments(CreateFragments(lines[l]));
            }

            _CurrentLine = null;
            StateHasChanged?.Invoke(this, EventArgs.Empty);
            return(this);
        }