spectre.console
spectre.console copied to clipboard
MultilineTaskDescriptionColumn for Progress
It would be useful to implement MultilineTaskDescriptionColumn for Progress. This didn't help me for multiline description:
public sealed class MultilineTaskDescriptionColumn : ProgressColumn
{
/// <inheritdoc/>
protected internal override bool NoWrap => true;
/// <inheritdoc/>
public override IRenderable Render(RenderContext context, ProgressTask task, TimeSpan deltaTime)
{
//var text = task.Description?.RemoveNewLines()?.Trim();
//return new Markup(text ?? string.Empty).Overflow(Overflow.Ellipsis).RightAligned();
return new Markup(task.Description ?? string.Empty);
}
}
Please upvote :+1: this issue if you are interested in it.
@Yaroshvitaliy You will need to set "NoWrap" to false
for that to work:
@patriksvensson I tried NoWrap set to false but it didn't help me. I mean Environment.NewLine is not working.
I can see the following code in ProgressTask:
description = description?.RemoveNewLines()?.Trim();
Yeah, Environment.Newline is probably not working. It will wrap the text at the end of the column.
Environment.Newline is what I need as a separator between lines, so could you reopen the issue since my original question is not answered? Maybe anoter string/object property can be added to ProgressTask so that it can be used in custom advabced columns?