Commands: Only use ambient context on same project

Fixes #990

Manually verified.
It can be null in which case, it will get the one selected in the drop-down..