You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issues
In fact, you will probably find several PowerShell modules that implement CD history in different ways. The one above is from PSCX. I've seen other modules that retain history and use fuzzy matching to find the directory with auto-completion as you type IIRC. There's likely enough variation here that this functionality is best implemented by 3rd party modules.
That's what I think. There are a lot of approaches for advanced usage and they are implemented or could be implemented as additional modules. Core functionality should be conservative and universal. PowerShell team agreed that cd - should be included in the core cd, but that's probably where we stop.
If cd - is in the core cd, doesn't that make cd into pushd and popd?
No, because it will only keep knowledge about 1 previous location. And this location could be $env:OLDPWD which would address the original issue described by S (@SRGOM)
I would love to use an actual programming language with a clean syntax as my shell but I will not give up the ease of access that comes with bash/zsh. I will list a few power tools/options that come to my mind that are absolutely indispensable to me and the power users I know.
History, big deal for most. I have this setopt histfindnodups histignoredups histignorespace. I want to be able to search through it, and very quickly
Moving around- I use github:rupa/z which is a fuzzy matcher. You think you can show a navigable dropdown in fuzzy cd mode? Maybe call it zd? z doesn't have a dropdown but its still very cool
Completion/editing - one area where I feel PSReadLine is lacking compared to bash/zsh. (Or maybe I don't know enough? Please correct me). Can't do Ctrl-X Ctrl-E (edit command in EDITOR), Alt-s, cycle through completions in bash or just repeated tabs in zsh.
TBC- I don't want PoSh to grow haphazardly like bash/zsh which are really pathetic for anything but interactive use. I also love the long-names, it makes my history so much better to read. But it's just very lacking for interactive use.
I hope you guys incorporate features from zsh while keeping Powershell consistent and solid.
Yes, definitely not only on unix. We would like to keep the experience as close as it possible on all platforms.
Absolutely agree about history. In fact, the very first PS code that I wrote was https://github.com/vors/PersistentHistory (yes, PowerShell didn't have persistent history built-in, kind of crazy). Meanwhile, PSReadLine was included in the out-of-the-box package and it addressed a lot of interactive usage issues, including history.
I.e. histfindnodups histignoredups == Set-PSReadlineOption -HistoryNoDuplicates. Ctrl-X Ctrl-E is probably not in the standard keybindings, but can be added with Set-PSReadlineKeyHandler
For moving around, there are projects inspired by autojump and z.sh
They haven't been ported to Unix yet, but ZLocation probably would be at some point.
Also, as Keith Hill (@rkeithhill) mentioned, PSCX has a replacement for cd. The point here is: there are a lot of different approaches about moving around and I don't think that we should pick THE ONE to be included in the core. They are already implemented (or could be implemented) as 3rd party modules.
Meanwhile, cerating things (like cd -) could and probably should be included in the out-of-the-box expirience, because it's well established and expected in unix shells.
Thanks for your reply, sergei (@vors). I agree about a careful boundary about what should be in powershell and what should be outside. I do think that certain useful functionality should be added-on by default using external packages, PS-Readline itself being a great example.
I think I agree about the history part btw- it doesn't belong in Powershell itself (just like a lot of things don't). I'm right now on Linux and not liking how zsh/bash handle history order and timestamps(love everything else history-related). Maybe there's a need to stop and think about the right way of doing things.
HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issues
Activity
vors commentedon Sep 5, 2016
Good point! We probably should add
cd -syntax at the same time.rkeithhill commentedon Sep 5, 2016
S (@SRGOM) For now you can use
Push-Location(alias pushd) andPop-Location(alias popd).rkeithhill commentedon Sep 5, 2016
sergei (@vors) if you're going to do that then go all the way and implement a directory history stack e.g.:
See https://github.com/Pscx/Pscx/blob/master/Src/Pscx/Modules/CD/Pscx.CD.psm1
vors commentedon Sep 5, 2016
Keith Hill (@rkeithhill)
cd -actually was part of #1083 (comment)Is this history stack used in other shells?
rkeithhill commentedon Sep 5, 2016
sergei (@vors) Take Command supports this: https://jpsoft.com/help/index.htm?cd.htm
In fact, you will probably find several PowerShell modules that implement CD history in different ways. The one above is from PSCX. I've seen other modules that retain history and use fuzzy matching to find the directory with auto-completion as you type IIRC. There's likely enough variation here that this functionality is best implemented by 3rd party modules.
vors commentedon Sep 5, 2016
That's what I think. There are a lot of approaches for advanced usage and they are implemented or could be implemented as additional modules. Core functionality should be conservative and universal. PowerShell team agreed that
cd -should be included in the corecd, but that's probably where we stop.Jaykul commentedon Sep 5, 2016
I'm a bit confused. If
cd -is in the core cd, doesn't that makecdintopushdandpopd?Or perhaps I should say: maybe you should implement
cdas a function which callspushd(orpopd).vors commentedon Sep 6, 2016
No, because it will only keep knowledge about 1 previous location. And this location could be
$env:OLDPWDwhich would address the original issue described by S (@SRGOM)SRGOM commentedon Sep 6, 2016
I should note that I wouldn't want this to be specific to OS-Linux, although yes such a functionality isn't present in Windows already.
Look at http://linux.die.net/man/1/zshoptions if you want to know what all options zsh has. A lot of us use a lot of options over there.
I would love to use an actual programming language with a clean syntax as my shell but I will not give up the ease of access that comes with bash/zsh. I will list a few power tools/options that come to my mind that are absolutely indispensable to me and the power users I know.
History, big deal for most. I have this
setopt histfindnodups histignoredups histignorespace. I want to be able to search through it, and very quicklyMoving around- I use github:rupa/z which is a fuzzy matcher. You think you can show a navigable dropdown in fuzzy
cdmode? Maybe call it zd? z doesn't have a dropdown but its still very coolCompletion/editing - one area where I feel PSReadLine is lacking compared to bash/zsh. (Or maybe I don't know enough? Please correct me). Can't do Ctrl-X Ctrl-E (edit command in EDITOR), Alt-s, cycle through completions in bash or just repeated tabs in zsh.
TBC- I don't want PoSh to grow haphazardly like bash/zsh which are really pathetic for anything but interactive use. I also love the long-names, it makes my history so much better to read. But it's just very lacking for interactive use.
I hope you guys incorporate features from zsh while keeping Powershell consistent and solid.
vors commentedon Sep 6, 2016
Thank you for the thoughtful feedback!
Yes, definitely not only on unix. We would like to keep the experience as close as it possible on all platforms.
Absolutely agree about history. In fact, the very first PS code that I wrote was https://github.com/vors/PersistentHistory (yes, PowerShell didn't have persistent history built-in, kind of crazy). Meanwhile, PSReadLine was included in the out-of-the-box package and it addressed a lot of interactive usage issues, including history.
I.e.
histfindnodups histignoredups==Set-PSReadlineOption -HistoryNoDuplicates.Ctrl-X Ctrl-Eis probably not in the standard keybindings, but can be added withSet-PSReadlineKeyHandlerFor moving around, there are projects inspired by
autojumpandz.shhttps://github.com/tkellogg/Jump-Location
https://github.com/vors/ZLocation
They haven't been ported to Unix yet, but ZLocation probably would be at some point.
Also, as Keith Hill (@rkeithhill) mentioned, PSCX has a replacement for
cd. The point here is: there are a lot of different approaches about moving around and I don't think that we should pick THE ONE to be included in the core. They are already implemented (or could be implemented) as 3rd party modules.Meanwhile, cerating things (like
cd -) could and probably should be included in the out-of-the-box expirience, because it's well established and expected in unix shells.SRGOM commentedon Sep 6, 2016
Thanks for your reply, sergei (@vors). I agree about a careful boundary about what should be in powershell and what should be outside. I do think that certain useful functionality should be added-on by default using external packages, PS-Readline itself being a great example.
SRGOM commentedon Sep 11, 2016
I think I agree about the history part btw- it doesn't belong in Powershell itself (just like a lot of things don't). I'm right now on Linux and not liking how zsh/bash handle history order and timestamps(love everything else history-related). Maybe there's a need to stop and think about the right way of doing things.
Bill-Stewart commentedon Jan 31, 2017
If we are talking about a location history (like command history, except locations only), then yes please.
bergmeister commentedon May 26, 2018
Ilya (@iSazonov) Can you please rename the issue title to reflect its current state better. Something like
Add support for 'cd -'?[-]Set-Location should set $env:OLDPWD[/-][+]Add support for 'cd -'[/+]Add location history for Set-Location to enable 'cd -' scenario (issue …
Revert "Add location history for Set-Location to enable 'cd -' scenar…
Add location history for Set-Location to enable 'cd -' scenario (issue …