From c41ef2484bededcad9bcc4c5e6ed8c96f7af798f Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Wed, 26 Apr 2023 23:09:30 +1000 Subject: [PATCH] fix -nonewline screen output for runx --- src/modules/shellrun-0.1.tm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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]