The moment was a little reminiscent of the climactic scene in “A Few Good Men,” when Tom Cruise’s character elicits an incriminating answer from Jack Nicholson’s Marine colonel. In this case, Ms. Pelosi and Mr. Schumer were more than happy to handle the president’s truth. Ms. Pelosi couldn’t say the term “Trump shutdown” enough times.

“We gave the president two options that would keep the government open,” the two leaders said in a joint statement after the remarkable White House session that offered a sneak peek at 2019’s divided government. “It’s his choice to accept one of those options or shut the government down.”

Mr. Trump has consistently played by his own rules in Washington, and perhaps this is just one more example of how he can upend the conventions of the capital and win a shutdown showdown on his own terms. Many of his most enthusiastic supporters are both anti-Washington and pro-border wall, so his decision to potentially close down a section of the federal government to secure funding for the wall could play well with them. It could also generate some welcome backing from his base at a time when he seems under siege on the legal end and is struggling to staff his administration as the two-year mark nears. In addition, the 2020 campaign is already on the president’s mind, and his efforts to limit immigration have worked for him in the past.

With Democrats about to take over the House, the president’s opportunities to win the wall money — a central facet of his 2016 campaign and one he has so far been thwarted on — are diminishing. As that window is closing, shutting down the government is starting to sound like a victory, at least in the president’s mind.

“If we have to close down the country over border security, I actually like that in terms of an issue,” Mr. Trump told reporters late Tuesday after the Democrats had departed. “I will take it because we are closing it down for border security, and I think I win that every single time.”