Noticed a bug on tool change prompt

Looking at your file, I don’t think we’re doing it wrong, I think your postprocessor is.

The g-code standard for M6 commands is that it changes to either the T command on the same line as the M6, or the last T command issued before that M6 if one isn’t on the same line.

See LinuxCNC standard: M-Codes

Your file issues a T21 early, some movement, then a M5 M6 on one line (with no T command) and the a T10 on a following line.

So what you’re seeing makes sense - the first M6 encountered has no T command on the same line, so it prompts you for the last T command sent (T21). The T10 on the line after the M6 is never reached - tool changing doesn’t look ahead, again reference the standard.

You’d need to have a M6 T21 and a M6 T10 (with the T10 on the same line as the M6) if you want the initial prompt for first tool and a second prompt to change to T10.