Sometimes I'd like to mark a directory in the shell, and skip back to it quickly later, like using marks in vim. Waypoint is designed to do just that.
In an Unix environment, there's no real way to change a parent process's working directory, aside from some really terrible thing I spotted on StackOverflow. I could think of 3 options:
- Spawn new shells, and try and keep the number of them under control.
- Write a terrible shell script that uses some voodoo magic to parse ini
files and
cd
to the appropriate directory, and thensource
that file. - Write a less-terrible Python script that writes a file that is then
source
d.
I chose option 3.
This is a terribly hacky solution - no, seriously, this is terrible. Don't use it if you're not aware of the Bad Things that can happen and are willing to accept those risks.
If you really, really want to try this, take a look at the instructions in
waypoint.sh
.
Shortly after starting this, raylu brought pushd and popd to my attention. They're pretty cool, I must say, but popd doesn't seem to have the kind of name-specified path-popping that I want. That said, if you just want to build a stack of paths and rewind back down, go use those instead of waypoint.
Huy Nguyen made a similar system called Bashmarks. It looks better off than mine.