President Donald Trump acted quickly to negotiate with Democratic senators on a deal to avert a government shutdown.