A rally is held in Seattle on Feb. 17. (Karen Ducey/Getty Images)

MORE THAN once, President Trump has enticed Democrats and some moderate Republicans — and risked infuriating hard-liners in his base — by expressing an openness to overhauling the nation’s dysfunctional immigration system. He did so again in a session at the White House with television news anchors Tuesday, saying he’d consider a compromise that included legal status for millions of undocumented immigrants, and then wondering aloud whether he should float the idea to Congress in his speech that night. He did not — but if he really wishes to bring about the “unity” and “renewal of the American spirit” he spoke of in his address, he should.

It is a fool’s game to guess whether the president will ultimately legalize or deport more of the nation’s 11 million undocumented immigrants; he himself may have no firm idea what he intends. But if he wants to soothe this festering political and social wound, he is well positioned to do it. Having established himself as a hard-liner on illegal immigration and proposed tough new measures to stop it, he might well persuade fellow Republicans to accept a compromise on the millions of noncriminal immigrants already in the country.

A good place to start would be the question of what to do about “dreamers,” the 2 million or so undocumented immigrants brought to this country as children. There Mr. Trump has been more consistent. After initially suggesting he would scrap the Obama administration’s program granting them temporary protection from deportation, the new president has repeatedly expressed sympathy for the dreamers’ plight, making clear he is disinclined to target them for removal and telling the news anchors he would be open to forging a pathway to citizenship for them.

Fair enough, but will he have the courage of his apparent convictions? The test is whether he acts to dispel the uncertainty hanging over the heads of roughly 750,000 dreamers whose age, duration of residence in the United States and verified clean record enabled them to register for the program, known as Deferred Action for Childhood Arrivals, which provides work permits and temporary protection from removal. Registrants, who submit their names, addresses and other information, are now justifiably fearful that the government may use that data to track them down once their two-year DACA protections lapse. Hundreds of thousands of other eligible youngsters are unlikely to enroll given that peril.

Dreamers represent a pool of talent, brains and ambition that the United States should want to cultivate. Some 3,700 students in the University of California system are undocumented immigrants, and tens of thousands of dreamers are enrolled at other post-secondary institutions across the country. What possible benefit is there in deporting a promising cohort that is American in all but birth certificate?

With the stroke of a pen, Mr. Trump could extend the existing program, enabling dreamers to continue working, studying and living productive lives. He could go further by proposing permanent legal status or a path to citizenship for immigrants who, in many cases, have little memory of any country but the United States. That would lend weight to the president’s oft-stated assertions of his compassion.