-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add location history for Set-Location to enable 'cd -' scenario (issue …
…#2188) (#5051) * Implement location history feature for Set-Location. This makes it possible to go back to the last directory using 'cd -', which is exactly the same syntax as on Linux shells. * Use an existing stack implementation instead of relying on an environment variable and move logic for 'cd -' into the internal class of SessionState.Path.SetLocation Keep the (additional) setting of an environment for Unix system in case of mixed usage of cd and Set-Location to provide consistency. * Use a bounded stack with a limit of 1000 and adapt tests. Remove setting environment variable on Linux as discussed in PR. * Fix test: use get-location explicitly to avoid subtle difference in the path string (e.g. an additional slash at the end) Make syntax to .net call of environment consistent with surrounding code * Move initialization of _workingLocationHistoryStack into constructor of SessionStateInternal and set the limit to 20 as discussed in PR 5051. * Make new BoundedStack class in engine utils internal
- Loading branch information
1 parent
7d72e38
commit bbd48f6
Showing
5 changed files
with
136 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters