In the interest of avoiding an XY problem, I'm trying to set up an iTerm profile to do the following when I hit the hotkey.
The command I'm working with so far is cd ~/my/directory/ && python -m SimpleHTTPServer 8000 &> /dev/null &
This works great for starting the server on the project root. The problem is, after it starts running in the background, my pwd is NOT ~/my/directory/. I guess that part is sent to the background too.
Is there a way to accomplish step 3 without having to cd again manually afterward?
This works for me
;
instead of &&
cd ~/my/directory/ ; python -m SimpleHTTPServer 8000 &> /dev/null &
or second command in ( )
cd ~/my/directory/ && (python -m SimpleHTTPServer 8000 &> /dev/null &)