Is it possible to have Xmonad open a new terminal in the same directory as the active terminal (if the active window is a terminal or a program like vim running in one)? As it is, all my terminals open in
$HOME. It does not matter to me if this happens if I open a new terminal in a different workspace. This would be a huge productivity gain because otherwise I would have to
cd all the way up to the directory I am working in.
If this is not possible to do directly using Xmonad, I am interested in alternative solutions to this. The only thing I can think of is to overload PROMPT_COMMAND to write out the current directory to a file and have my
.bashrc look at this file to determine where to go. But this is a very imperfect solution that would work for many cases, but will leave a good majority incorrect.