A terminal gap is an alignment gap which starts in the first column or ends in the last column. Local alignments never have terminal gaps.
An internal gap is any gap that is not a terminal gap. Local alignments may have internal gaps.
The global alignment below has terminal and internal gaps indicated. The -show_termgaps option was used for the ‑alnout output file. Note that the number of columns (302 in this example) is always reported without terminal gaps, as these are the columns used to calculate identity.