Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Invoke-History to detect recursive call of the same history entry#13197

Merged
daxian-dbw merged 1 commit intoPowerShell:masterfrom
daxian-dbw:history
Jul 23, 2020
Merged

Fix Invoke-History to detect recursive call of the same history entry#13197
daxian-dbw merged 1 commit intoPowerShell:masterfrom
daxian-dbw:history

Conversation

@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Jul 17, 2020

PR Summary

Fix #13183

Fix Invoke-History to detect recursive invocation of history entries.
The old loop detection seems depend on the history invocation runs in the same pipeline, but that's not the case any more (maybe changed in v5).

The fix is to move the loop-detection logic to the History class. A Runspace holds a History instance, it's like a singleton in the Runspace scope. not really a singleton because a new instance will be used if you reset the Runspace, but there is only one instance per Runspace at a given time.

PR Checklist

Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix typo in title.

@daxian-dbw daxian-dbw changed the title Fix Invoke-Command to detect recursive call of the same history entry Fix Invoke-History to detect recursive call of the same history entry Jul 17, 2020
@daxian-dbw daxian-dbw merged commit f6f966b into PowerShell:master Jul 23, 2020
@daxian-dbw daxian-dbw deleted the history branch July 23, 2020 16:11
@daxian-dbw daxian-dbw added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jul 23, 2020
@daxian-dbw daxian-dbw added this to the 7.1.0-preview.7 milestone Jul 23, 2020
@TravisEz13 TravisEz13 modified the milestones: 7.1.0-preview.7, 7.1.0-preview.6 Aug 5, 2020
@ghost
Copy link

ghost commented Aug 17, 2020

🎉v7.1.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invoke-History can cause stack overflow.

3 participants