Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PSReadLine/PSReadLine.psm1
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
function PSConsoleHostReadLine
{
[System.Diagnostics.DebuggerHidden()]
param()

## Get the execution status of the last accepted user input.
## This needs to be done as the first thing because any script run will flush $?.
$lastRunStatus = $?
Expand Down
4 changes: 2 additions & 2 deletions PSReadLine/ReadLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ internal static PSKeyInfo ReadKey()
if (ps == null)
{
ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
ps.AddScript("0", useLocalScope: true);
ps.AddScript("[System.Diagnostics.DebuggerHidden()]param() 0", useLocalScope: true);
}

// To detect output during possible event processing, see if the cursor moved
Expand Down Expand Up @@ -674,7 +674,7 @@ private PSConsoleReadLine()
{
try
{
var results = ps.AddScript("$Host", useLocalScope: true).Invoke<PSHost>();
var results = ps.AddScript("[System.Diagnostics.DebuggerHidden()]param() $Host", useLocalScope: true).Invoke<PSHost>();
PSHost host = results.Count == 1 ? results[0] : null;
hostName = host?.Name;
}
Expand Down