New Yorkers on Wednesday were mourning the eight dead from a terrorist attack in Lower Manhattan and wondering how vulnerable they and their families might be, even as they picked themselves up, as New Yorkers do, and went on with life.

Some of them inevitably thought back to another beautiful fall day in Lower Manhattan, on Sept. 11, 2001. After that day, they remembered, they and their nation were led in mourning, and toward unity, by a president who shared their sorrow and understood his own role.

The current American president reacted rather differently.

“A Chuck Schumer beauty,” Mr. Trump tweeted on Wednesday, blaming an immigrant visa program, signed into law by President George H.W. Bush and supported by Senator Schumer, for the fact that the terrorism suspect, an immigrant from Uzbekistan, was in this country as a legal resident.

Mr. Trump might instead have rallied the nation. But he could not resist resorting to his campaign fantasy that closing the nation’s borders to those whom he selectively targets is the all-purpose solution to terrorist violence. Overnight, he and the nativist media seized on the title of the program — the Diversity Visa Lottery — to portray it as a “politically correct” indulgence undermining the country, rather than affirming its core values.