diff --git a/commune/module/_os.py b/commune/module/_os.py index 91a9958c3..2290ecab6 100644 --- a/commune/module/_os.py +++ b/commune/module/_os.py @@ -243,6 +243,8 @@ def stream_output(process): modes = ['stdout', 'stderr'] for mode in modes: pipe = getattr(process, mode) + if pipe == None: + continue for line in iter(pipe.readline, b''): line = line.decode('utf-8') if verbose: @@ -261,7 +263,7 @@ def stream_output(process): else: text = '' for ch in streamer: - text += ch + text += (ch + '\n') return text diff --git a/commune/modules/remote/app.py b/commune/modules/remote/app.py index bdc7a80e3..b05e711ad 100644 --- a/commune/modules/remote/app.py +++ b/commune/modules/remote/app.py @@ -202,6 +202,7 @@ def ssh(self): emoji = c.emoji("cross") if is_error else c.emoji("check") stats = host2stats.get(host, {'success': 0, 'error': 0}) title = f'{emoji} :: {host} :: {emoji}' + if not is_error: msg = result.strip() msg = fn_code(msg) @@ -209,7 +210,7 @@ def ssh(self): stats['success'] += 1 with st.expander(f'Results {host}', expanded=expanded): st.write(title) - st.write(msg) + st.code('\n'.join(msg.split('\n'))) else: msg = result stats['error'] += 1