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
I was looking for something cross-plat (windows, macos, linux) that could work in bash, zsh and windows-powershell.
I had to write the j script myself in powershell (because j.bat only works in CMD). I had to hook into cd (set-location), pushd (Push-Location) and popd (Pop-Location), such that the tool could learn how I navigate the filesystem. I have chosen to convert any new location to an absolute path before calling --add sub-command, in order for .., ../.. and other relative paths to have universal meaning (at least at my windows pc).
I wanted to avoid someting like this (because relative paths would loose all meaning in the dynamic config because the tool doesn't know relative to what folder!)
According to upstream autojump's hook scripts, for example the one for zsh, you can see it uses pwd to get the current directory, which is always absolute. The reason you described is valid.
I had to write the j script myself in powershell (because j.bat only works in CMD).
Aha, i knew i was missing something - i just installed it via scoop and was severely confused and left only with a single autojump.exe binary.
So from what I understand, unless you want to manually add each entry to the index via --add or write/find your own powershell integration, the extras/autojump package on scoop (Added in ScoopInstaller/Extras#8377) is currently not usable.
As I believe powershell has mostly superseded cmd for manual shell use, a powershell integration is pretty essential for windows support. Perhaps @maxild could share theirs?
The commands (such as cd) could then be hooked by just running the hook command/script inside the Powershell $PROFILE file.
(See similar: Installation flow for starship) Additionally, the scoop package manifest should be updated to also download the powershell integration, or it should be included in the windows downloads during the CI build
I was looking for something cross-plat (windows, macos, linux) that could work in bash, zsh and windows-powershell.
I had to write the
j
script myself in powershell (because j.bat only works in CMD). I had to hook intocd
(set-location),pushd
(Push-Location) andpopd
(Pop-Location), such that the tool could learn how I navigate the filesystem. I have chosen to convert any new location to an absolute path before calling--add
sub-command, in order for..
,../..
and other relative paths to have universal meaning (at least at my windows pc).I wanted to avoid someting like this (because relative paths would loose all meaning in the dynamic config because the tool doesn't know relative to what folder!)
Is this how it should be done?
The text was updated successfully, but these errors were encountered: