diff --git a/src/modules/shellrun-0.1.tm b/src/modules/shellrun-0.1.tm index 0fe58a77..3745d324 100644 --- a/src/modules/shellrun-0.1.tm +++ b/src/modules/shellrun-0.1.tm @@ -338,14 +338,24 @@ namespace eval shellrun { set chunk "" if {[string length $::shellrun::runout]} { - append chunk "$::shellrun::runout\n" + if {$nonewline} { + set o [string trimright $::shellrun::runout \r\n] + } else { + set o $::shellrun::runout + } + append chunk $o\n } lappend chunklist [list stdout $chunk] set chunk "[a+ red bold]stderr[a+]\n" if {[string length $::shellrun::runerr]} { - append chunk "$::shellrun::runerr\n" + if {$nonewline} { + set e [string trimright $::shellrun::runerr \r\n] + } else { + set e $::shellrun::runerr + } + append chunk $e\n } lappend chunklist [list stderr $chunk]