It is my understanding that after the assassination of Lincoln, President Johnson wanted to try Confederate leaders and it was Ulysses S. Grant who stood in his way, stating he would resign his commission if Johnson went ahead.
"Following the end of Civil War hostilities in 1865, there were many in the North who wanted the civil and military officials of the Confederacy to stand trial for treason. The assassination of Abraham Lincoln further flamed the desire of many to take vengeance upon the South and its leaders, particularly Gen. Robert E. Lee.
The New York Times was a leading proponent for treason charges against Lee, writing in a June 4, 1865 editorial: “He has ‘levied war against the United States’ more strenuously than any other man in the land, and thereby has been specially guilty of the crime of treason, as defined in the Constitution of the United States,” and “whether Gen. Lee should be hung or not, is a minor question.”
President Andrew Johnson was another advocate of harsh treatment for Lee and his generals, but he was soon to learn his views were in direct contrast to those of the North’s war hero, Gen. Ulysses S. Grant."
https://www.civilwarprofiles.com/grant-protects-lee-from-treason-trial/
Also from the link:
"When Lee, who was preparing to apply for amnesty, became aware of the indictments, he wrote Grant asking if the Appomattox terms were still in effect.
After reading Lee’s letter, Grant forwarded his own views to Secretary of War Edwin Stanton on June 16, 1865:
In my opinion the officers and men paroled at Appomattox Court-House, and since, upon the same terms given to Lee, cannot be tried for treason so long as they observe the terms of their parole. This is my understanding. Good faith, as well as true policy, dictates that we should observe the conditions of that convention. Bad faith on the part of the Government, or a construction of that convention subjecting the officers to trial for treason, would produce a feeling of insecurity in the minds of all the paroled officers and men. If so disposed they might even regard such an infraction of terms by the Government as an entire release from all obligations on their part. I will state further that the terms granted by me met with the hearty approval of the President at the time, and of the country generally. The action of Judge Underwood, in Norfolk, has already had an injurious effect, and I would ask that he be ordered to quash all indictments found against paroled prisoners of war, and to desist from further prosecution of them.
Grant also visited personally with President Johnson to discuss the situation, but was dismayed to find that Johnson fully intended to let the proceedings continue. Grant insisted the Appomattox terms be honored. Johnson asked when the men could be tried. “Never,” Grant responded, “unless they violate their paroles.”