I do this with an Alfred workflow, I hit command+space and then type “ft” and it opens the front most Finder window’s directory in Terminal (or iTerm, you can set it to whatever)