What does middle click do in terminal? For a while now I noticed that 'randomly', my terminal will paste in recent command/log as input.

I finally narrowed it down to the fact that I have jitouch installed with 3 finger tap as 'middle-click'. But using command + tap/click does not produce the same behavior. Does anyone know what is the actual event sent by jitouch's middle-click and what command is it triggering to paste?

I'm just curious.
Terminal.app in itself makes the middle-button work as "paste". This is similar to how you would expect the middle-button to paste when using for example Linux.

So jitouch is not really triggering a special command or sending a non-standard event - it is really just sending the middle-button click event as usual. It is just Terminal.app that decides to interpret this as a request to paste from clipboard.