File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/PowerShellEditorServices/Session Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -720,8 +720,6 @@ private async Task StartReplLoop(CancellationToken cancellationToken)
720720
721721 if ( commandString != null )
722722 {
723- this . WriteOutput ( string . Empty ) ;
724-
725723 if ( ! string . IsNullOrWhiteSpace ( commandString ) )
726724 {
727725 var unusedTask =
@@ -735,6 +733,10 @@ private async Task StartReplLoop(CancellationToken cancellationToken)
735733
736734 break ;
737735 }
736+ else
737+ {
738+ this . WriteOutput ( string . Empty ) ;
739+ }
738740 }
739741 }
740742 while ( ! cancellationToken . IsCancellationRequested ) ;
Original file line number Diff line number Diff line change @@ -715,11 +715,12 @@ public async Task<IEnumerable<object>> ExecuteScriptString(
715715 bool writeOutputToHost ,
716716 bool addToHistory )
717717 {
718+ // Get rid of leading and trailing whitespace and newlines
719+ scriptString = scriptString . Trim ( ) ;
720+
718721 if ( writeInputToHost )
719722 {
720- this . WriteOutput (
721- scriptString + Environment . NewLine ,
722- true ) ;
723+ this . WriteOutput ( scriptString , false ) ;
723724 }
724725
725726 PSCommand psCommand = new PSCommand ( ) ;
You can’t perform that action at this time.
0 commit comments