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)
720
720
721
721
if ( commandString != null )
722
722
{
723
- this . WriteOutput ( string . Empty ) ;
724
-
725
723
if ( ! string . IsNullOrWhiteSpace ( commandString ) )
726
724
{
727
725
var unusedTask =
@@ -735,6 +733,10 @@ private async Task StartReplLoop(CancellationToken cancellationToken)
735
733
736
734
break ;
737
735
}
736
+ else
737
+ {
738
+ this . WriteOutput ( string . Empty ) ;
739
+ }
738
740
}
739
741
}
740
742
while ( ! cancellationToken . IsCancellationRequested ) ;
Original file line number Diff line number Diff line change @@ -715,11 +715,12 @@ public async Task<IEnumerable<object>> ExecuteScriptString(
715
715
bool writeOutputToHost ,
716
716
bool addToHistory )
717
717
{
718
+ // Get rid of leading and trailing whitespace and newlines
719
+ scriptString = scriptString . Trim ( ) ;
720
+
718
721
if ( writeInputToHost )
719
722
{
720
- this . WriteOutput (
721
- scriptString + Environment . NewLine ,
722
- true ) ;
723
+ this . WriteOutput ( scriptString , false ) ;
723
724
}
724
725
725
726
PSCommand psCommand = new PSCommand ( ) ;
You can’t perform that action at this time.
0 commit comments