4 ms·
How does it know where you are standing when it isn't the full path? It must integrate with the shell somehow, right?
by iso8859-1 15y ago
How does it know where you are standing when it isn't the full path? It must integrate with the shell somehow, right?
- _chendo_ 15y agoHeh, that was a fun one to figure out. When digging around in iTerm2 source, I found out that you can figure out the current working directory of the shell, so that was relatively easy. The hard part was my goal of getting it to work even if you change the working directory, so that paths that were legit before stay legit. I found out that my shell sends an escape code that updated the terminal title when it changed directories, so I hooked it into that, but it turns out that's oh-my-zsh specific. I also added the ability for it to work even with spaces, which is essentially a brute-force, so it's not pretty.