Steven McIntyre,19, killed Jack Doyle, of Greenock, on January 3, in Antigua Street, in the town.
The court heard the stab wound cut through his liver and severed two blood vessels. He bled to death.
Callous McIntyre was playing with his Xbox just hours after Jack died.
Yesterday at the High Court in Glasgow temporary judge Sean Murphy QC told McIntyre he would be detained without limit of time.
Judge Murphy added: "You are a young man and Jack Doyle was also a young man. It is depressing to note that by the age of 18 you had been convicted of assault on four occasions.
"That night it was Jack Doyle who was showing a knife to others.
"You chased Jack Doyle and then stabbed him through the heart."
Co-accused Kevin McIntyre, 28, who had admitted slashing Jack on the face just minutes before he was murdered, was jailed for five years and six months.
This is the second time tragedy has struck the Doyle family. Jack's aunt Elaine Doyle was 16 when she was murdered on June 1, 1986. Her body was discovered in a lane just yards from her home in Ardgowan Street, Greenock. She had been strangled. Her killer has never been brought to justice.
During his trial Steven McIntyre claimed that he had acted in self-defence.